It took me a bit to finally find code that works for this, so here's hoping this will help you out. The code will connect to an SMTP server and send a message off. Some SMTP servers require your full e-mail address, while others require only your username. Try both until it works.
sub sendmail { my $smtp = Net::SMTP->new('servername', Hello => 'hellodomain'); $smtp->auth('username', 'password'); $smtp->mail("recipient_address"); $smtp->to('recipient_address"'); $smtp->data(); $smtp->datasend("To: ... \n"); $smtp->datasend("From: ... \n"); $smtp->datasend("Subject: ...\n"); $smtp->datasend("\n"); $smtp->datasend("..."); $smtp->dataend(); $smtp->quit; }