-
-
31 May 2017 05:30:43 UTC
- Distribution: Mail-Builder
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (1)
- Testers (383 / 347 / 3)
- Kwalitee
Bus factor: 1- 82.07% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (52.74KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Maroš Kollár
NAME
Mail::Builder::Image - Class for handling inline images
SYNOPSIS
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;
DESCRIPTION
This class handles inline images that should be displayed in html e-mail messages.
METHODS
Constructor
new
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.
Public Methods
serialize
Returns the image file as a MIME::Entity object.
filename
If possible, returns the filename of the image file as a Path::Class::File object.
filecontent
Returns the content of the image file.
filehandle
If possible, returns a filehandle for the image file as a IO::File object.
Accessors
id
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"/>
mimetype
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.
file
Image. Can be a
Path (or a Path::Class::File object)
Filehandle (or an IO::File object)
ScalarRef containing the image data
AUTHOR
Maroš Kollár CPAN ID: MAROS maros [at] k-1.com http://www.k-1.com
Module Install Instructions
To install Mail::Builder, copy and paste the appropriate command in to your terminal.
cpanm Mail::Builder
perl -MCPAN -e shell install Mail::Builder
For more information on module installation, please visit the detailed CPAN module installation guide.