#!perl -w # if you change your mail server, you may need to change the From: # address below. $mail{From} = 'Sendmail Test '; $mail{To} = 'Sendmail Test , You me@myaddress'; $server = 'mail.webhost4life.com'; use Mail::Sendmail; if ($server) { $mail{Smtp} = $server; } $mail{Subject} = "Mail::Sendmail version $Mail::Sendmail::VERSION test"; $mail{Message} = "This is a test message sent with Perl version $] from a $^O system.\n\n"; $mail{Message} .= "It contains an accented letter: à (a grave).\n"; $mail{Message} .= "It was sent on " . Mail::Sendmail::time_to_date() . "\n"; # Go send it if (sendmail %mail) { print "content of \$Mail::Sendmail::log:\n$Mail::Sendmail::log\n"; if ($Mail::Sendmail::error) { print "content of \$Mail::Sendmail::error:\n$Mail::Sendmail::error\n"; } print "ok 2\n"; } else { print "\n!Error sending mail:\n$Mail::Sendmail::error\n"; print "not ok 2\n"; }