Not a Member Yet,
Click here to Register

ID: 2
Viewed: 4105
Added: Nov 14, 2001
Snippet uploaded by: snippet
Written By: snippet
Demo: Sorry, no demo

User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

this loops thru a email list that is stored in an array and send to everybody in that array. Can also set a time limit so the script doesn't time out.



// set up a message
$subject = "Your subject.";
$msg = "I'm looping mail!";
$headers = "From: me@mycompany.comnReply-To:";
// this is your array of addresses
$addresses = array("", "", "");
// remember, array indices start at 0
For($i = 0; $i < count($addresses); $i++) {
// get the recipient address
$To = $addresses[$i];
//send the mail
mail("$to", "$subject", "$msg", "$headers");
//print a confirmation to the screen
echo "mail sent to $to <br>";

//To set a time limit within a script, you use the set_time_limit() //function. You can specify the limit, such as 60 seconds
//, or you can allow it to run until it's absolutely done

No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.

Replying to a Comment...

Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!