in reply to Simple Net::SMTP question

Having read the documentation and the relevant code I believe this to be a documentation defect.

You must not only pass a hash-like string but it must be in fact an actual hash.

Try changing your options to

my @recipients = $smtp->recipient('collin.starkweather@colorado.edu',' +joe@flugwumpet.com', { Notify => 1, SkipBad => 1 });

I think it will magically begin to work.

Replies are listed 'Best First'.
Re: Re: Simple Net::SMTP question
by Starky (Chaplain) on Aug 24, 2001 at 03:02 UTC
    Thanks a million! That's exactly it.

    On a final note, now that I have it working, I'm getting

    Net::SMTP::recipient: DSN option not supported by host at /home/bogususer/bin/test.pl line 6
    
    from several of my campus mail relays. (See this for more information about DSN.) In lieu of DSN, all of the e-mail addresses are returned whether they are valid or not.

    So the moral of the story is that SkipBad relies on DSN, and not all SMTP servers support DSN.

    Thanks again for your help!

      Not quite. Probably Notify is the one that requires DSN to work on the server (normally doesn't).

      To check wether a recipient is valid or not, the module depends on the response from the mail server. Relaying servers are often configured to delay address checks and to accept things that seem vaguely as email addresses.

      This is probably what you're seing.

      Good luck.