For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2007 > sendmail









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author sendmail
Irfan Sayed

2007-02-20, 7:58 am

Hi All,

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.

Please help

Regards
Irfan.


Prasanna Kumar Nagasamudram

2007-02-20, 7:58 am



-----Original Message-----
From: Sayed, Irfan (Irfan) [mailto:isayed@avaya.com]=20
Sent: Tuesday, February 20, 2007 4:07 PM
To: beginners@perl.org
Subject: sendmail

Hi All,
=20
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.
=20
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.
=20
Please help
=20
Regards
Irfan.
=20

Hi Irfan

Can you please send the code snippet, so that it will be easy to
identify the problem if any?



Thanks
Prasanna
Paul Lalli

2007-02-20, 7:58 am

On Feb 20, 5:36 am, isa...@avaya.com (Irfan Sayed) wrote:
> 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.
>
> Please help


You have an error on line 42.

Jeff Pang

2007-02-20, 7:58 am



>=20
>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.
>=20
>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.
>=20


Hello,

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

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

$smtp->mail("Jeff\@corp.netease.com");
$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.

--
=E7=A5=9D=E6=89=80=E6=9C=89=E4=B8=AD=E5=
8D=8EPerl=E7=94=A8=E6=88=B7=E6=96=
=B0=E6=98=A5=E5=BF=AB=E4=B9=90!
Happy New Year for all Chinese Perl guys!
JupiterHost.Net

2007-02-22, 4:00 am



Jeff Pang wrote:
>
>
>
> 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("Jeff\@corp.netease.com");
> $smtp->recipient(@email_addresses);



Mail::Sender::Easy


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com