--------------------------------------------------- | Date: 2003-01-26 23:21:42 | | Filename: net-smtp.pl | | Author: detour@metalshell.com | | | | http://www.metalshell.com/ | --------------------------------------------------- #!/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;