
lisali
New User
Nov 20, 2016, 4:20 PM
Post #1 of 5
(9369 views)
|
How do you send the same email to multiple recipients with Sendmail & PERL?
|
Can't Post
|
|
Hello! I have the following PERL script, but I can't seem to get it to send to more than one email at once. How do I send to multiple emails within the same script, preferably as separate emails, CC, BCC or just an additional TO:? Thank you! :)
open(SENDMAIL, "|/usr/lib/sendmail -oi -t") || die "Cannot open sendmail output"; print SENDMAIL <<"ENDENDEND"; From: <test\@test.com> To: <test1\@test1.com> Subject: report spam MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="DeathToSpamDeathToSpamDeathToSpam" This is a multi-part message in MIME format. --DeathToSpamDeathToSpamDeathToSpam Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit --DeathToSpamDeathToSpamDeathToSpam Content-Type: message/rfc822 Content-Disposition: attachment ENDENDEND while (<STDIN>) { print SENDMAIL ; } print SENDMAIL <<"ENDENDEND"; --DeathToSpamDeathToSpamDeathToSpam-- ENDENDEND close (SENDMAIL);
|