Mail::Builder::Image - Class for handling inline images
use Mail::Builder::Image; my $image1 = Mail::Builder::Image->new({ file => 'path/to/image.png', id => 'location', }); my $image2 = Mail::Builder::Image->new($fh); my $image1_entity = $image1->serialize;
This class handles inline images that should be displayed in html e-mail messages.
The constructor can be called in multiple ways
Mail::Builder::Image->new({ file => Path | Path::Class::File | IO::File | FH | ScalarRef, [ id => Image id, ] [ mimetype => MIME type, ] }) OR Mail::Builder::Image->new( Path | Path::Class::File | IO::File | FH | ScalarRef [, Image id [, MIME type ]] )
See Accessors for more details.
Returns the image file as a MIME::Entity object.
If possible, returns the filename of the image file as a Path::Class::File object.
Returns the content of the image file.
If possible, returns a filehandle for the image file as a IO::File object.
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"/>
Mime type of the image. Valid types are
image/gif
image/jpeg
image/png
If not provided the mime type is determined by analyzing the filename extension and file content.
Image. Can be a
Path (or a Path::Class::File object)
Filehandle (or an IO::File object)
ScalarRef containing the image data
Maroš Kollár CPAN ID: MAROS maros [at] k-1.com http://www.k-1.com
To install Mail::Builder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::Builder
CPAN shell
perl -MCPAN -e shell install Mail::Builder
For more information on module installation, please visit the detailed CPAN module installation guide.