MIME::Lite uses Net::SMTP to actually do smtp mail sending. But when trying to use it in my Win32 application, basically because it can handle authentication in the 3.01_05 version, I found that I was still not getting connections. As many ISP's block outgoing connections on port 25 we need to use alternative ports, 587 and 857 being commn.

After probing around in the code I found the solution was extremely simple and may save someone else some grief.

The list of options which will be passed is found in this array at line 2813. Port is not in it, so add it as I have done here and then it does just what it needs to.

my @_net_smtp_opts = qw( Hello LocalAddr LocalPort Port Timeout ExactA +ddresses Debug );
jdtoronto

Updated I noted this information here at the same time as posting to rt.cpan.org
Updated As suggested, has been marked up in AnnoCPAN, thanks diotalevi.


In reply to MIME::Lite does not pass PORT to Net::SMTP by jdtoronto

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.