Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Problems? Is your data what you think it is?
 
PerlMonks  

Using Net::SMTP to Bcc, Cc or multiple recipients

by Anonymous Monk
on Nov 03, 2000 at 17:32 UTC ( [id://39873]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (programs and processes)

Question: How can I Bcc, Cc or send mail to multiple recipients using the following code. use Net::SMTP; # Send the message and disconnect $smtp=Net::SMTP->new('$host'); $smtp->mail($from); $smtp->recipient($to); $smtp->data("Subject: $subject\r\n$body"); $smtp->quit; -thanks-

Originally posted as a Categorized Question.

  • Comment on Using Net::SMTP to Bcc, Cc or multiple recipients

Replies are listed 'Best First'.
Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by Fastolfe (Vicar) on Nov 03, 2000 at 20:17 UTC
    From the Net::SMTP documentation:
    recipient ( ADDRESS [, ADDRESS [ ...]] [, OPTIONS ] )<p> Notify the server that the current message should be sent to all of th +e addresses given. Each address is sent as a separate command to the +server.

    Originally posted as a Categorized Answer.

Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by Fastolfe (Vicar) on Nov 03, 2000 at 20:19 UTC
    From the Net::SMTP documentation:
    recipient ( ADDRESS [, ADDRESS [ ...]] [, OPTIONS ] ) Notify the server that the current message should be sent to all of the addresses given. Each address is sent as a separate command to the server.
Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by Fastolfe (Vicar) on Nov 03, 2000 at 20:21 UTC
    From the Net::SMTP documentation:
    recipient ( ADDRESS [, ADDRESS [ ...]] [, OPTIONS ] ) Notify the server that the current message should be sent to all of the addresses given. Each address is sent as a separate command to the server.

    Originally posted as a Categorized Answer.

Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by strredwolf (Chaplain) on Nov 04, 2000 at 02:46 UTC
    Only if you have proof that the recipients confirmed their request can you use Net::SMTP with no fear of loosing your ISP's account.

    Originally posted as a Categorized Answer.

Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by Anonymous Monk on Apr 15, 2001 at 00:59 UTC
    Try sending the multiple recipients as an array. Such as: @to = ('first@yahoo.com', 'second@server.com'); $smtp->recipient(@to); It worked for me :)
      the answer is fine,its works
        all you need to do is following in @to have an array fo reciepients and then foreach (@to) { $smtp->datasend("To: $_\n"); }
      Does not work for me!
Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by Anonymous Monk on Aug 02, 2004 at 16:23 UTC
    anyád

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://39873]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.