The script below works on one Windows 7 machine but hangs on another Windows 7 machine. Both are running the same version of Perl(5.16.3). I have tried capturing the debug output in a file but the debug file is always blank.
If I step through the code using a debugger it hangs at file named eval(3758).
sub READLINE { my $self = shift(); my $socket = $self->[SOCKET]; my $line = <$socket>; ####hang on this line $self->[LOG]->print(">> $line") if defined $line and !$self->[OFF] +; return $line; }
The only difference that I can see between the 2 machines is that the one that works has Outlook 2007 and the one that does not has Outlook 2010 but as far as I can tell Perl isn't using Outlook to send the email. Both machines can send/receive email from the same email server and same email account this script uses if it is done through Outlook. Nothing odd showing up in the event logs on the pc.
#works on my laptop but not on desktop use warnings; use strict; use Mail::Sender; my $sender; print "here 1\n"; open(my $DEBUG, ">>" , "SendMailDebug.txt") or die "Can't open the debug file: $!\n"; $sender = new Mail::Sender { smtp => 'mysmtp', from => 'myaccount', auth => 'LOGIN', authid => 'myauthid', authpwd => 'mypassword', on_errors => 'code', debug => $DEBUG, debug_level => 4, timeout => 2, } or die "Can't create the Mail::Sender object: $Mail::S +ender::Error\n"; print "here 2\n"; #### When it hangs it never displays text past this point ####### $sender->Open({ from => 'me', to =>'me@work', subject => 'Sorry, I\'ll come later.' }) or die "Can't open the message: $sender->{'error_msg'} +\n"; print "here 3\n"; $sender->SendLineEnc("I'm sorry, but thanks to the lusers, I'll come at 10pm at best."); $sender->SendLineEnc("\nHi, Jenda"); print "here 4\n"; $sender->Close() or die "Failed to send the message: $sender->{'error_m +sg'}\n";
Any suggestions on what I can do to figure out what is making it hang would be appreciated.
In reply to Mail::Sender hangs on one machine but not another by godsham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |