Send plain/html e-mails through smtp servers (platform independent). supports smtp authentication and attachments.
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.
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 ;}
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 ;}
%OPTIONS:
The \s-1SMTP\s0 server. (Default: localhost)
The \s-1SMTP\s0 port. (Default: 25)
The time to wait for the connection and data. (Default: 120)
The username for authentication.
The password for authentication.
%OPTIONS:
The e-mail adress of the sender. (Only accept one adress).
The name or title of the sender.
E-mail used to reply to your e-mail.
E-mail to send error messages.
Recipient e-mail adresses.
Adresses to receive a copy.
The subject of your e-mail.
The plain message.
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.
An \s-1ID\s0 to insert in the e-mail Headers. The header will be: Msg-ID: xxxxx
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.
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.
Mail::SendEasy::SMTP, Mail::SendEasy::AUTH, \s-1HPL\s0.
This module was created to handle the e-mail system of \s-1HPL\s0.
Graciliano M. P. <[email protected]>
I will appreciate any type of feedback (include your opinions and/or suggestions). ;-P
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.