Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by Anonymous Monk
on Nov 03, 2000 at 22:32 UTC ( #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 Anonymous Monk on Aug 02, 2004 at 20:23 UTC
    anyád

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2021-04-19 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?