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

I want to send 100 e-mails with php

Status
Not open for further replies.

gameon

Programmer
Feb 23, 2001
325
GB
Hi,I have a list of 100 subscribers. Can I use php to send them all. I have tried using ',' between e-mail addresses- but it will not work.

Does anyone know how to.

Cheers if you can help...

Matt
 
Whats the code you have so far?

You should store all of the email adresses in a database, btw.

Anyway:

[tt]
<?php

$filename = &quot;addresses.txt&quot;;
$fd = fopen ($filename, &quot;r&quot;);
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
$addrs = split(&quot;,&quot;,$addresses);
for ($i=0; $i<count($addrs); $i++) {
mail($addrs[$i],&quot;subject&quot;,&quot;body of the email&quot;);
}

?>
[/tt]

Assume that the addresses.txt text file that contains all of the addresses separated by comma's. Then, PHP opens the file, splits it up into an array, and then loops through the array, mailing the info that you want to each person.

Hope this helps.

-Vic
vic cherubini
krs-one@cnunited.com
 
Hi. Thanks for your help. I think I've done it wrong though. It says that there is an Internal server error.

How do you execute? I have just been looking at the page in a browser.

Cheers,

M@
 
hi
what i can say is check your server configuration or tell your system administrator about it.

spookie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top