athan
asked on
How to create send mail in pl. Im using ActiverPerl, IIS 6, Win 2003.
How to create send mail in pl. Im using ActiverPerl, IIS 6, Win 2003.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How do I install the SMTP? Do I need an SMTP server to run this?
Net::SMTP is a core module, which means that it's included with Perl. You would install MIME::Lite and/or Mail::SendEasy with Activestate's ppm utility.
ppm install Mime::Lite
ppm install Mail::SendEasy
ppm install Mime::Lite
ppm install Mail::SendEasy
ASKER
Thanks.
use Mail::SendEasy ;
my $mail = new Mail::SendEasy(
smtp => 'SERVER NAME' ,
user => 'USER NAME' ,
pass => 'PASSWORD',
) ;
my $status = $mail->send(
from => 'abc@abc.com' ,
from_title => 'hi' ,
reply => 'abc@abc.com' ,
error => 'abc@abc.com' ,
to => 'abc@abc.com' ,
cc => '' ,
subject => "TEST" ,
msg => "hi" ,
html => "<b>Frm perl script...</b>",
msgid => "0101" ,
anex => "D:/home/bin/kp.txt", #attachment
) ;
if (!$status) { print $mail->error ;}