For sending mail from multi-platforms (such as using a Windows 2000 Professional machine for testing, moving the code to Windows 2000 Advanced Server and then to a Linux box), I tend to use Mime::Lite. It's available via Activestate PPM (so it's extremely easy to install on a Windows machine), you can configure it to either Sendmail (if you've got it installed) or connect directly to your mail server, you can add 'attachments' and it's got plenty of example code for you to examine and try - one of the simplist ways that I use it is:
use Mime::Lite
MIME::Lite->send('smtp', $mail_server_name_or_ip_address, TimeOut=>60)
+;
my $msg=MIME::Lite->new (
From=>"$from_name <$from_email_address>",
To =>"$to_email_address",
Subject=>"$subject_of_email",
Type=>'text',
Data=>$body_of_email
);
$msg->send;
There is also Mail::Sender and Net::SMTP for you to consider. An example of Net::SMTP code is:
use Net::SMTP
my $smtp=Net::SMTP->new($mailserver_name_or_ip_address);
$smtp->mail($from_address);
$smtp->to($to_address);
$smtp->data();
$smtp->datasend("To: $to_address\n");
$smtp->datasend("From: $from_address\n");
$smtp->datasend("Subject: $message_subject\n");
$smtp->datasend("\n$body_of_email\n");
$smtp->dataend();
$smtp->quit;