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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.