in reply to How to send email when executing PERL on Windows NT
Two modules come to mind when using win32. Mail::SendMail and Net::SMTP. Net::SMTP requires that you have at least a rudimentary knowledge of the SMTP commands because you have to follow the proper order when sending a mail. OTOH Mail::SendMail only requires you have all the proper parts of an email (From: To: Message:) which it appears you have in your code snippet. Here's a quick snip from the docs to illustrate how easy it is:
use Mail::Sendmail; %mail = ( To => 'you@there.com', From => 'me@here.com', Message => "This is a very short message" ); sendmail(%mail) or die $Mail::Sendmail::error;
I think it's also worth mentioning that Mail::SendMail is "platform independent" which means you could replace your code example with one that works everywhere!
ryddler
|
|---|