kbforme has asked for the wisdom of the Perl Monks concerning the following question:
Can any one help me in sending mail from perl script to multiple users? In the following script, indicating one mail address (for To field) works fine. But when multiple mail id's are indicated (comma or semicolon separated), no mails are being sent.
my $from = 'address'; my $to = 'address'; my $mime_type = "TEXT"; my $smtp = Net::SMTP->new('host') or die $!; $smtp->mail( $from ); $smtp->to($to); $smtp->data(); $smtp->datasend("To: $to\n"); $smtp->datasend("From: $from\n"); #$smtp->datasend("Subject: $subject\n"); $smtp->datasend("Subject: $_[0]\n"); $smtp->datasend("\n"); # done with header #$smtp->datasend($message); $smtp->datasend($_[1]); $smtp->dataend(); $smtp->quit(); # all done. message sent.
20040528 Edit by Corion: Added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending mails to multiple users
by Anonymous Monk on May 28, 2004 at 10:56 UTC | |
by muntfish (Chaplain) on May 28, 2004 at 11:45 UTC | |
|
Re: Sending mails to multiple users
by markjugg (Curate) on May 28, 2004 at 14:16 UTC | |
|
Re: Sending mails to multiple users
by nimdokk (Vicar) on May 28, 2004 at 13:10 UTC |