Thanks for your prompt reply :-)

I discovered I forgot the $smtp->mail() call in the above example, but it doesn't change the fact that I can't get the SkipBad option to work.

I tried all of the following combinations, uncommenting the recipient lines one at a time:

#!/usr/bin/perl
use Net::SMTP;
my $smtp = Net::SMTP->new('mail.bogusdomain.com');
die "Ugh." unless defined $smtp;
$smtp->mail($ENV{USER});
my @recipients = $smtp->recipient('totallybogus', SkipBad => 1);
#my @recipients = $smtp->recipient('totallybogus', Notify => 1, SkipBad => 1);
#my @recipients = $smtp->recipient('joe@flugwumpet.com', Notify => 1, SkipBad => 1);
#my @recipients = $smtp->recipient('joe@flugwumpet.com', SkipBad => 1);
#my @recipients = $smtp->recipient('bogususer@bogusdomain.com', Notify => 1, SkipBad => 1);
#my @recipients = $smtp->recipient('bogususer@bogusdomain.com', SkipBad => 1);
print "Recipients are '@recipients'\n";
$smtp->data();
$smtp->datasend('To:  bogususer@bogusdomain.com, joe@flugwumpet.com' . qq{\n});
$smtp->datasend('Subject:  A test.' . qq{\n});
$smtp->datasend("\n");
$smtp->datasend("This is a test.");
$smtp->dataend();
$smtp->quit();
and in every case, I got
What? ~/bin/test.pl
Recipients are '1'
What?
The address bogususer@bogusdomain.com is a valid address (I changed the user and domain names in this post to protect the innocent), joe@flugwumpet.com is an invalid address, and totallybogus is an *obviously* bad address.

I even received both e-mails to the correct recipient and failure notices to the bogus addresses from the mailer daemon.

I am seriously considering the possiblity that the SkipBad option simply does not work as advertised. That would seem odd given that Net::SMTP is probably one of the most heavily used modules on the CPAN.

Harumph!


In reply to Re: Re: Simple Net::SMTP question by Starky
in thread 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.