use Net::SMTP; # Get ready to send messages via SMTP $thetext = "From: me\@myself.org\n"; $thetext .= "To: you\@yourself.com\n"; $thetext .= "Subject: Some Stuff\n"; $thetext .= "\n"; # Send the message and disconnect $smtp=Net::SMTP->new('localhost'); $smtp->mail("me\@myself.org"); $smtp->recipient("you\@yourself.com"); $smtp->data($thetext); $smtp->quit;