in reply to Email sending in Activeperl 5 on Windows

This wont fly: $smtp = Net::SMTP->new('$my_host'); the single quotes stop Perl from interpolating the $my_host so you are trying to connect to a host called $my_host, literally.

This sets the sender: $smtp->mail($ENV{USER}); and this sets the recipient $smtp->to($mail_to);. But beware that most public SMTP servers nowadays require a valid and full email sender address and so $env{USER} wont cut it as it is just your login name unknown to say yahoo mail server. Unless of course you are using your local mail server. But even in this case, sometimes such scripts as yours are run by cron and the username in that case may be something else than what you think you are sending out.

Also, I would check the return of each command for success before proceeding to the next, for example:

my $smtp = Net::SMTP->new('$my_host'); die "error connecting to $my_host" unless defined $smtp; $smtp->mail($ENV{USER}) or die "error issuing MAIL command: ".$smtp->m +essage(); ...

When you do all these then you have every right to declare Email sent successfully

5' Edit: for debugging purposes, one can talk to the SMTP server manually via telnet (if it does not require to talk TLS or SSL). Net::SMTP replaces the following:

telnet mysmtphost.com 25 HELO myip MAIL FROM: myemail@abc.com RCPT TO: recipient@xyz.com DATA helo there blah blah .

hacky days