How to create send mail in pl.  Im using ActiverPerl, IIS 6, Win 2003.

Posted on 2007-03-23
Last Modified: 2010-03-05
How to create send mail in pl.  Im using ActiverPerl, IIS 6, Win 2003.
Question by:athan
  • 2
  • 2
LVL 28

Accepted Solution

FishMonger earned 50 total points
ID: 18784398

Expert Comment

ID: 18790636
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 => '' ,
from_title => 'hi' ,
reply => '' ,
error => '' ,
to => '' ,
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 ;}

Author Comment

ID: 18792210
How do I install the SMTP? Do I need an SMTP server to run this?
LVL 28

Expert Comment

ID: 18794520
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

Author Comment

ID: 18799440

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl output collect 7 67
Any syntax error for this clone.plscript 6 140
Executing multiple sybase statements in perl dbi 2 93
Perl passing in variables to do substitution 6 73
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question