Hello.
I'm using the standard procedure of the Net::SMTP module to send emails from a Windows box with Strawberry, and it works if I use a plain SMTP connection, but when I use SSL it hangs at the dataend method (which is part of the Net::Cmd module).
I searched and found some other reports, but not a solution.
The piece of code is:
my $smtp = Net::SMTP->new(Host => $mailserver, SSL => 0, Debug => 1, + Timeout => 30); $smtp->auth($username, $password); $smtp->mail($myemail); if ($smtp->to($destemail)) { $smtp->data(); $smtp->datasend("From: $myemail\n"); $smtp->datasend("To: $destemail\n"); $smtp->datasend("Date: $date\n"); $smtp->datasend("Subject: A test\n"); $smtp->datasend("\n"); warn "(end of header)\n"; $smtp->datasend("This is a test...\n"); warn "(end of body)\n"; $smtp->dataend; warn "(dataend completed)\n"; } else { print "ERROR: ", $smtp->message(); } warn "(bye...)\n"; $smtp->quit;
With SSL=>1, debug trace shows all the messages from the (successful) authentication up to "end of body" message and hangs for a while, then a timeout message appears.
I also tried without the dataend, but the quit seems to call dataend internally and the problem persists.
What am I missing?
I don't want to hack standard mods...
In reply to Net::SMTP and SSL timeout problem by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |