in reply to Re: sending to multiple recipients with Net::SMTP
in thread sending to multiple recipients with Net::SMTP
Perhaps not the cleanest, but it works quite nicely.@email=qw(address1@host1.com address2@host2.com address3@host3.com); $smtp->new('my.mailhost'); $smtp->mail('myaddress@myhost.com'); foreach (<@email>) { $smtp->to($_); } $smtp->datasend("Rule 42 is now in effect.\n"); $smtp->dataend; $smtp->quit;
Update: forgot the $smtp->quit;. Also removed commas from @email=qw(...) per comment below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: sending to multiple recipients with Net::SMTP
by muntfish (Chaplain) on Nov 08, 2004 at 13:52 UTC | |
by nimdokk (Vicar) on Nov 08, 2004 at 16:28 UTC |