-
-
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::Attachment - Class for handling e-mail attachments
SYNOPSIS
use Mail::Builder::Attachment; my $attachment1 = Mail::Builder::Attachment->new({ file => 'path/to/attachment.pdf', name => 'LoveLetter.txt.vbs', }); my $attachment2 = Mail::Builder::Attachment->new($fh); my $attachment_entity = $attachment1->serialize;
DESCRIPTION
This class handles e-mail attachments for Mail::Builder.
METHODS
Constructor
new
The constructor can be called in multiple ways
Mail::Builder::Attachment->new({ file => Path | Path::Class::File | IO::File | FH | ScalarRef, [ name => Attachment filename, ] [ mimetype => MIME type, ] }) OR Mail::Builder::Image->new( Path | Path::Class::File | IO::File | FH | ScalarRef [, Attachment filename [, MIME type ]] )
See Accessors for more details.
Public Methods
serialize
Returns the attachment as a MIME::Entity object.
filename
If possible, returns the filename of the attachment file as a Path::Class::File object.
filecontent
Returns the content of the attachment file.
filehandle
If possible, returns a filehandle for the attachment file as a IO::File object.
Accessors
name
Name of the attachment as used in the e-mail message. If no name is provided the current filename will be used.
mimetype
Mime type of the attachment.
If not provided the mime type is determined by analyzing the filename extension.
file
Attachment file. Can be a
Path (or a Path::Class::File object)
Filehandle (or an IO::File object)
ScalarRef containing the attachment 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.