Hmm, depends on the definition of 'works' maybe :) Your solution doesn't result in any error or so, but it doesn't really test if the SMTP server supports DSN!

Did you try $smtpc->command('supports', 'DSN') with two SMTP servers, one which supports DSN and one that doesn't? I believe your approach wouldn't catch SMTP servers that do not support DSN. I believe Net::Cmd::command() is used to send protocol-level commands to the remote server.

However, checking if DSN is supported doesn't need interaction with the remote server. Upon creation of a Net::SMTP object, the object sends EHLO to the remote server and the remote server responds with the supported ESMTP extensions, which Net::SMTP stores in $self->{net_smtp_esmtp}. When called, Net::SMTP::supports() queries this hash.

Now you probably ask yourself, if this guy knows so much about this stuff, then why did he get stuck with the trivial defined. I think there is a point in that question... LOL


In reply to Re: Re: Finding supported ESMTP Extensions with Net::SMTP by dub4u
in thread Finding supported ESMTP Extensions with Net::SMTP by dub4u

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.