Maroš Kollár > Mail-Builder-1.12 > Mail::Builder::Attachment::Data

Download:
Mail-Builder-1.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View Bugs
Report a bug
Source  

NAME ^

Mail::Builder::Attachment::Data - Module for handling attachments from data

SYNOPSIS ^

  use Mail::Builder;
  
  my $attachment = Mail::Builder::Attachment::Data($data,'invitation.pdf','application/pdf');
  $attachment->name('party_invitation.pdf');
  print $attachment->serialize;
  
  # Append the attachment to an Mail::Builder object
  $mb->attachment($attachment); # this removes all other attachments
  OR
  $mb->attachment->add($mail);

DESCRIPTION ^

This module allows you to add attachments from data.

METHODS ^

Constructor

new

 my $obj = Mail::Builder::Attachment::Data->new(CONTENT,NAME,MIME);

Takes the data ,the file name as it should be diplayed in the e-mail message and a mime type.

Public methods

compare

 $obj->compara(OBJECT);
 or 
 $obj->compara(DATA);

Checks if two attachment objects contains the same data. Returns true or false. The compare method does not check if the mime types and name attributes of the two objects are identical.

Instead of a Mail::Builder::Attachment::Data object you can also pass a scalar value representing the data.

serialize

Returns the attachment as a MIME::Entity object.

Accessors

data

Accessor which takes/returns the data.

name

Accessor which takes/returns the name of the file as displayed in the e-mail message.

mime

Accessor which takes/returns the mime type of the file.

AUTHOR ^

    Maroš Kollár
    CPAN ID: MAROS
    maros [at] k-1.com
    http://www.k-1.com