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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Email

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

I have a text file that I would like to be able to email to several email addresses on a nightly basis. The file is updated during the day then these details will need to be passed to a selection of email addresses. Is this possible to automate this without me having to paste all the addresses into my mail program and attach the file?

Thanks,

Darren
 
Sorry but I don't exactly know what you're talking about. I used to do that on text files. Here's something similar:



open(MFILE, "mails.txt");
@email = <MFILE>;
close(MFILE);


foreach (@email) {
open(M, &quot;|/usr/lib/sendmail -t&quot;);
print M &quot;To: $_\n&quot;;
print M &quot;From: your_name\@host.com\n&quot;;
print M &quot;Subject: subject\n&quot;;
print M &quot;$mail_msg<BR>&quot;;
close(M);
}

Hope it helps.

 
In order to get this to happen automatically every night you'll also need to set up a cron job (on unix, anyway). Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top