DESCRIPTION

This modules will send in a easy way e-mails, and doesn't have dependencies. Soo, you don't need to install libnet.

It supports \s-1SMTP\s0 authentication and attachments.

USAGE

\s-1OO\s0

  use Mail::SendEasy ;

  my $mail = new Mail::SendEasy(
  smtp => 'localhost' ,
  user => 'foo' ,
  pass => 123 ,
  ) ;

  my $status = $mail->send(
  from    => '[email protected]' ,
  from_title => 'Foo Name' ,
  reply   => '[email protected]' ,
  error   => '[email protected]' ,
  to      => '[email protected]' ,
  cc      => '[email protected]' ,
  subject => "MAIL Test" ,
  msg     => "The Plain Msg..." ,
  html    => "<b>The HTML Msg...</b>" ,
  msgid   => "0101" ,
  ) ;

  if (!$status) { print $mail->error ;}

\s-1STRUCTURED\s0

use Mail::SendEasy ;

my $status = Mail::SendEasy::send( smtp => 'localhost' , user => 'foo' , pass => 123 , from => '[email protected]' , from_title => 'Foo Name' , reply => '[email protected]' , error => '[email protected]' , to => '[email protected]' , cc => '[email protected]' , subject => "MAIL Test" , msg => "The Plain Msg..." , html => "<b>The HTML Msg...</b>" , msgid => "0101" , ) ;

if (!$status) { Mail::SendEasy::error ;}

METHODS

new (%OPTIONS)

%OPTIONS:

smtp

The \s-1SMTP\s0 server. (Default: localhost)

port

The \s-1SMTP\s0 port. (Default: 25)

timeout

The time to wait for the connection and data. (Default: 120)

user

The username for authentication.

pass

The password for authentication.

send (%OPTIONS)

%OPTIONS:

from

The e-mail adress of the sender. (Only accept one adress).

from_title

The name or title of the sender.

reply

E-mail used to reply to your e-mail.

error

E-mail to send error messages.

to

Recipient e-mail adresses.

cc

Adresses to receive a copy.

subject

The subject of your e-mail.

msg

The plain message.

html

The \s-1HTML\s0 message. If used with \s-1MSG\s0 (plain), the format \*(L"multipart/alternative\*(R" will be used. Readers that can read \s-1HTML\s0 messages will use the \s-1HTML\s0 argument, and readers with only plain messages will use \s-1MSG\s0.

msgid

An \s-1ID\s0 to insert in the e-mail Headers. The header will be: Msg-ID: xxxxx

anex

Send file(s) attached. Just put the right path in the machine for the file. For more than one file use \s-1ARRAY\s0 ref: ['file1','file2'] ** Will load all the files in the memory.

zipanex

Compress with zip the \s-1ANEX\s0 (attached) file(s). All the files will be inside the same zip file. If the argument has the extension .zip, will be used for the name of the zip file. If not, the file will be \*(L"anex.zip\*(R", and if exist only one \s-1ANEX\s0, the name will be the same of the \s-1ANEX\s0, but with the extension .zip. ** Need the module Archive::Zip installed or the argument will be skipped. ** This will generate the zip file in the memory.

RELATED TO Mail::SendEasy…

Mail::SendEasy::SMTP, Mail::SendEasy::AUTH, \s-1HPL\s0.

This module was created to handle the e-mail system of \s-1HPL\s0.

AUTHOR

Graciliano M. P. <[email protected]>

I will appreciate any type of feedback (include your opinions and/or suggestions). ;-P

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.