Mail::Builder::Image::File - Module for handling inline images from files
use Mail::Builder; my $image = new Mail::Builder::Image::File('/home/guybrush/invitation.gif'); # 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=""/>
This is a simple module for handling inline images. The module needs the path to the file and optional an id which can be used to reference the file from within the e-mail text.
Mail::Builder::Image::File->new(PATH[,REFERENCE ID]);
Simple constructor
Returns the image as a MIME::Entity object.
$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 .
Mail::Builder::Image
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=""/>
Accessor which takes/returns the path of the file on the filesystem. The file must be readable. Only .jpeg, .jpg, .gif and .png files may be added.
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.