Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

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

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 Anonymous Monk on Apr 15, 2001 at 04: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 Fastolfe (Vicar) on Nov 04, 2000 at 01: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 04, 2000 at 01: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 Anonymous Monk on Aug 02, 2004 at 20:23 UTC
    anyád
Re: Using Net::SMTP to Bcc, Cc or multiple recipients
by strredwolf (Chaplain) on Nov 04, 2000 at 07: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 Fastolfe (Vicar) on Nov 04, 2000 at 01: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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://39873]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-20 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found