NAME
Mail::Builder::Image::Data - Module for handling inline images from data
SYNOPSIS
use Mail::Builder;
my $image = new Mail::Builder::Image::Data($data,'invitation');
# Change CID
$image->id('invitation_location');
# Mail::Builder object
$mb->image($image);
OR
$mb->image->add($image);
# In the e-mail body
<img src="cid:invitation_location" alt=""/>
DESCRIPTION
This is a simple module for handling inline images. The module needs the image content and an id which can be used to reference the file from within the e-mail text.
METHODS
Constructor
new
Mail::Builder::Image::Data->new(PATH,REFERENCE ID);
Simple constructor
Public Methods
serialize
Returns the image as a MIME::Entity object.
compare
$obj->compare(OBJECT);
or
$obj->compare(PATH);
Checks if two image objects contain the same file. Returns true or false. The compare method does not check if the image id of the two objects are identical.
Instead of a Mail::Builder::Image
object you can also pass a scalar value representing the image path .
Accessors
id
Accessor which takes/returns the id of the file. If no id is provided the lowercase filename without the extension will be used as the id.
The id is needed to reference the image in the e-mail body: <img src="cid:invitation_location" alt=""/>
data
Accessor which takes/returns the content of the image. Only .jpeg, .jpg, .gif and .png files may be added.
AUTHOR
Maroš Kollár
CPAN ID: MAROS
maros [at] k-1.com
http://www.k-1.com