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
In reply to Sending mails to multiple users by kbforme
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |