I am sending some mail via Net::SMTP. In the PODs regarding the recipient method, it says
The `recipient' method can some additional OPTIONS which is passed in hash like fashion, using key and value pairs. Possible options are: Notify => SkipBad => ignore bad addresses If `SkipBad' is true the `recipient' will not return an error when a bad address is encountered and it will return an array of addresses that did succeed.
My first point of confusion is about the Notify option. What does it do?

However, what I'm really interested in is the SkipBad option.

I would like, as it says, to get back a list of addresses that did succeed.

However, a simple test:

#!/usr/bin/perl use Net::SMTP; my $smtp = Net::SMTP->new('rintintin.colorado.edu'); die "Ugh." unless defined $smtp; my @recipients = $smtp->recipient('collin.starkweather@colorado.edu',' +joe@flugwumpet.com', Notify => 1, SkipBad => 1); print "Recipients are [@recipients]\n";
returns
What? ~/bin/test.pl Recipients are [0] What?
(Note I also tried it without the Notify option.)

The first address I know to be good, the second bad. The PODs are fairly unambiguous. Is this just bad documentation? Has anyone else actually gotten this option to work? Am I totally misreading what seems to be a fairly straightforward statement of how it works?

Any help from someone who has either gotten this to work or positively knows whether it should work or not would be much appreciated.

Thanks in advance, brothers :-)

Edit Masem 2001-08-24 - PRE to CODE tags


In reply to Simple Net::SMTP question by Starky

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.