Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending 3 emails at a time

Status
Not open for further replies.

PhoenixDown

Programmer
Jul 2, 2001
279
CA
I'm using this:

Code:
open (MAIL,"|$Sendmail -t") || die "Unable to open sendmail: $Sendmail";
print MAIL qq~To: $in{'RecipentsEmail'}\n~;
print MAIL qq~From: &quot;$in{'SendersName'}&quot; <$in{'SendersEmail'}>\n~;
print MAIL qq~Subject: $in{'Subject'}\n~;
print MAIL qq~\n~;
print MAIL qq~$in{'Message'}\n~;
print MAIL qq~\n~;
print MAIL qq~$IP\n~;
print MAIL qq~$Host\n~;
print MAIL qq~\n~;
print MAIL qq~.~;
close MAIL;

How would I modify that to send 3 emails to the same person? Thanks.

AIM: XCalvin1984
 
Write it as a sub-routine and call it three times?
:)

Loon
 
How? AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
It's going to to be a variable configured by the administrator. So what if they want 15? What if they want 2? I don't want to keep calling sub routines all the time. Thanks for replying.
AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
^^^ AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
Why would you want to send the same email to the same person mulitple times?

Regardless of why, why don't you want to keep calling subroutines? That's what they're for. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Just for testing a perl module I'm making. AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
How would I use a loop to do it? AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
I got it to work:

Code:
foreach (1.. $in{'NumberToSend'}) {
#open (MAIL,&quot;|cat&quot;) || die &quot;Unable to open: $Sendmail.&quot;;
open (MAIL,&quot;|$Sendmail -t&quot;) || die &quot;Unable to open sendmail: $Sendmail&quot;;
print MAIL qq~To: $in{'RecipentsEmail'}\n~;
print MAIL qq~From: &quot;$in{'SendersName'}&quot; <$in{'SendersEmail'}>\n~;
print MAIL qq~Subject: $in{'Subject'}\n~;
print MAIL qq~\n~;
print MAIL qq~$in{'Message'}\n~;
print MAIL qq~\n~;
print MAIL qq~IP: $IP\n~;
print MAIL qq~Hostname: $Host\n~;
print MAIL qq~\n~;
print MAIL qq~.~;
close MAIL;
}

AIM: XCalvin1984
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top