



(94 votes)#!/usr/bin/perl # # net-smtp.pl by detour@metalshell.com # # Send an email using Net::SMTP to communicate to a SMTP server. # # http://www.metalshell.com # use Net::SMTP; $from = 'your@localemail.com'; $to = 'someone@else.com'; $subject = 'Test Email'; $smtp = Net::SMTP->new('localhost'); $smtp->mail($from); $smtp->to($to); $smtp->data(); $smtp->datasend("To: $to\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("Testy\n\n-bye"); $smtp->dataend(); $smtp->quit;