WalkingZero has asked for the wisdom of the Perl Monks concerning the following question:

Hello again. I have transfered my script to win32 due to requirements form up on high. I made a testrun of my script and it hangs. I ripped everything with threads out of it and it still hangs isolating the problem to either Net::SMTP or Net::smtp_auth. Anyone have any ideas on why this would be? Stripped code is as follows:
#!/usr/bin/perl -w use Net::SMTP; use Net::SMTP_auth; %maildrop=( <censored for security> ); sub smtpblast{ my $md= shift; my $user= $maildrop{"$md" . "user"}; my $pass= $maildrop{"$md". "pass"}; print "\n $user \n $pass \n"; my $mailer=Net::SMTP_auth->new('smtp.<censored>.com'); $mailer->auth('Login', $user, $pass); $mailer->mail("$user"); $mailer->to('<censored>'); my $mid= 'MID: ' . $md . " " . `date`; my @data=("Subject: $mid\n", "E-mail Blast message from $user\n"); $mailer->data(@data); $mailer->datasend(); $mailer->dataend; $mailer->quit; print LOGFILE ($mid); } open LOGFILE, ">>messages.log"; &smtpblast("md01");

Replies are listed 'Best First'.
Re: Net::smtp_auth hangs on win32
by syphilis (Archbishop) on Aug 24, 2007 at 01:33 UTC
    Hi WalkingZero,

    Could it be a firewall issue ?

    Have you checked to see at precisely which line the hang occurs ?

Re: Net::smtp_auth hangs on win32
by Corion (Patriarch) on Aug 24, 2007 at 06:26 UTC

    Also, for debugging SMTP issues, I found swaks extremely useful. It's even written in Perl!

      I actually figured out the problem. Ironically I figured it out when I was not only not working on it, but not even thinking about it. I was driving home from a lnog trip tonight and it jsut suddenyl came to me. The date system call doesn't work the same in Windows, and it was waiting for input but never giving me the prompt. As soon as I remove the `date` we have go time! Sorry for the waste of space. Cheers.