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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

867 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now