Mail::Builder::Attachment::Data


NAME

Mail::Builder::Attachment - Helper 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);
  
  =head1 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.

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

 Mail::Builder::Attachment::Data