in reply to How to send mails from a Windows system


I've always used Mail::Mailer from MailTools. Here's some example code:

use Mail::Mailer; my $body = "This is the message body, line 1\n"; $body .= "This is the message body, line 2\n"; my $mailer = Mail::Mailer->new( 'smtp', Server => '') or die "Unable to create a new mailer object:$!\n"; $mailer->open({ From => "jfluhmann\", To => "jeremy\", Subject => "Test E-mail"}) or die "Unable to populate mailer object:$!\n"; print $mailer $body; $mailer->close;

You should also take a look at Mail::Sender (for attaching files or sending in HTML with a plaintext alternative). I hope that helps!