peterr has asked for the wisdom of the Perl Monks concerning the following question:
I cannot work out why the following script does not work
#!/usr/bin/perl -wT use Net::SMTP; $smtp = Net::SMTP->new('mailservername.net', Debug => 1, ); $smtp->mail('peter@mydomain.com'); $smtp->to("peter\@home.emailaddress.com"); $smtp->data(); $smtp->datasend("To: Peter\n"); $smtp->datasend("\n"); $smtp->datasend("test send\n"); $smtp->dataend(); $smtp->quit;
There are no error messages, and no email received, yet when I use the (NMS) FormMail.pl on the same domain (my feedback form), I get an email back in one minute (I'm using Perl 5.006001). The script is starting to 'talk' to the mail server, because when I try to get the server 'banner', it gives me:
"mailservername.net ESMTP Exim 4.20 #1 Sat, 04 Oct 2003 01:28:37 -0400 "
Are there any methods to debug this script ? To somehow see what the email server is doing, any way to get 'echos' displayed, or any modules to add to give me debug information (The "error_log" file is empty, btw) Are there any issues with the code that could make it not work ?
Peter
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SMTP and debugging ?
by demerphq (Chancellor) on Oct 04, 2003 at 12:17 UTC | |
by peterr (Scribe) on Oct 04, 2003 at 12:47 UTC | |
by peterr (Scribe) on Oct 06, 2003 at 02:00 UTC | |
by demerphq (Chancellor) on Oct 06, 2003 at 11:22 UTC | |
by peterr (Scribe) on Oct 07, 2003 at 01:02 UTC | |
by peterr (Scribe) on Oct 07, 2003 at 01:41 UTC |