> 
>I need to send mail to all users defined in one array. I tried foreach
>loop but what is happening is it is sending mail to only first user in
>the array. not sending mails to rest of the users.
> 
>Is there any way to send a mail to all users in array in one shot. I am
>using sendmail 2.09 module from CPAN.
> 

Hello,

Just give my suggestion.I usually use Net::SMTP to sendmail to multi-recipients.
Using this module you don't need to foreach loop to sendmail.
For example,it can write:

        my $smtp = Net::SMTP->new('Host'=>$mtahost,'Port'=>$mtaport);

        $smtp->mail("[EMAIL PROTECTED]");
        $smtp->recipient(@email_addresses);


But,here is a problem that even only one email address in @email_addresses is 
failed,the whole smtp session should get failed.

--
祝所有中华Perl用户新春快乐!
Happy New Year for all Chinese Perl guys!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to