G'day godsham,

The first thing I'd try is either removing "timeout => 2," or setting it to its default value of 120. The very short timeout you currently have may be the problem. Note that this timeout value is only stored by the Mail::Sender constructor; it's actually used (later on) by the IO::Socket::INET constructor in Mail::Sender's Connect() method.

The next thing I'd check is the various values (e.g. auth*, smtp, etc.) you have. Do these need to be different on the machines you're running your script from? When you've tested this manually, are (some of) these automatically entered for you? Try removing stored values accessed by the email client and entering them yourself for the manual tests. Compare the full header details from your manual tests: how do they differ? do any differences need to be reflected in your script?

Other places to check include: the FAQ, WARNING and GOTCHAS sections of the Mail::Sender documentation; instances of "Outlook" in that documentation; and Active bugs for Mail-Sender. Some of those might not be immediately relevant but, once you get over the current hurdle, may be useful.

Here's some additional information based on what you've reported. (I've emboldened your quotes to differentiate from documentation quotes.)

"I have tried capturing the debug output in a file but the debug file is always blank."

The Mail::Sender constructor documentation says:

"Prepares a sender. This doesn't start any connection to the server. You have to use $Sender-Open or $Sender-OpenMultipart to start talking to the server."

and a bit further down under the debug parameter:

"All the conversation with the server will be logged to that file or handle."

So, as there's no connection yet, no conversation with the server will occur: this explains the empty debug file.

"If I step through the code using a debugger it hangs at file named eval(3758). ... sub READLINE {...}"

That's not a "file named eval"; it's the code compiled by a call to eval.

Checking through the Mail::Sender (v0.8.22) source code: Open() calls Connect() which calls __Debug() which has:

eval $debug_code;

You'll find $debug_code defined with a heredoc which includes the same "sub READLINE {...}" you've reported.

-- Ken


In reply to Re: Mail::Sender hangs on one machine but not another by kcott
in thread 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.