Looking for free mass mailing or bulk mailing php scripts to send multiple emails to your list at once?? This script will help you in that case. Additional recipient emails can be added to the first variable separating them by commas, not semicolons.
$to = “[email protected],[email protected]“;
A more advanced method is to put a newline separated email list into a text file, trim each entry, implode them into an array variable and use the array variable as the $to value.
Steps to Send Multiple Emails:
Step 1: Create a “elist.txt” file and continue as follows !
Mail List ( elist.txt )
[email protected] [email protected] [email protected] [email protected]
Step 2: Create “test.php” file with contents below.
PHP email script ( test.php )
<!--?php <br ?--> // read the list of emails from the file. $email_list = file(“elist.txt”); // count how many emails there are. $total_emails = count($email_list); // go through the list and trim off the newline character. for ($counter=0; $counter<$total_emails; $counter++) { $email_list[$counter] = trim($email_list[$counter]); } // implode the list into a single variable, put commas in, apply as $to value. $to = implode(“,”,$email_list); $subject = “My email test.”; $message = “Hello, how are you?”; if ( mail($to,$subject,$message) ) { echo “The email has been sent!”; } else { echo “The email has failed!”; } ?>
Step 3: Upload to your server and run “test.php” file from your browser. It should work now.
Having a newline separated email list is much easier to manage and edit. An alternative would be to start off with a long comma separated list and get rid of the TRIM and IMPLODE command lines.
You may use it to send newsletters for your clients in matter of minutes. Note that, if you;re trying to email more than 200 at once, you might need to confirm with your host about the same. most web hosting providers don’t allow more than 200 per hour. you can get rid of it just by delaying a hour between successive list.
Important Note:
Be very sure you know what you are doing. This can be a powerful script. Bulk emailing may be considered as SPAM if you’re emailing to random list. You might even be charged a penalty for spamming the server by your host as your server IP will be marked spamming by the ISP of your web hosting provider!
Leave a Reply