Link to home
Start Free TrialLog in
Avatar of athan
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
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sample code to send mail using Mail::SendEasy .


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 ;}
Avatar of athan
athan

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
Avatar of athan

ASKER

Thanks.