use strict; use Net::SMTP; my $recipient1 = 'john@hotmail.com'; my $smtp = Net::SMTP->new('myhost.com' ); #$smtp->mail ($ENV{USER}); To: $recipient1; From: $ENV{USER}; Subject: "A Message"; "Test message to check my code"; $smtp->datasend(); $smtp->quit;