CodeDome Posted November 16, 2011 Share Posted November 16, 2011 hey there i am new on this forum yea basicly when im sending more than 3-500 mails at a time the subject changes to "unknown" and the $from also changes to unknown :/ could anyone explain this ? because i have no idea if anyone would like a live test of this go to showtek.net23.net its on a 000webhost ik its just temprarily for testing and here's my code that sends the mails <?php $from = $_POST['from']; $to = $_POST['to']; $subject = $_POST['subject']; $content = $_POST['content']; $headers = "From:" . $from; $myFile = "mails.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $myfile; fwrite($fh, $stringData); fclose($fh); $email_list = file("mails.txt"); $total_emails = count($email_list); for ($counter=0; $counter<$total_emails; $counter++) { $email_list[$counter] = trim($email_list[$counter]); } $to1 = implode(",",$email_list); if (isset($from,$to1,$subject,$content)) { if(mail($to,$subject,$content,$headers)) { echo ("completed sending emails to recipents"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/251265-problem-when-sending-mail-to-over-3-500-people-at-a-time/ Share on other sites More sharing options...
freelance84 Posted November 17, 2011 Share Posted November 17, 2011 http://php.net/manual/en/function.mail.php Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient. For the sending of large amounts of email, see the » PEAR::Mail, and » PEAR::Mail_Queue packages. Quote Link to comment https://forums.phpfreaks.com/topic/251265-problem-when-sending-mail-to-over-3-500-people-at-a-time/#findComment-1288899 Share on other sites More sharing options...
phporcaffeine Posted November 17, 2011 Share Posted November 17, 2011 http://www.phpfreaks.com/forums/index.php?topic=347969.msg1642112#msg1642112 I've never been a fan of using PHP, natively, for mass emailing. Among many reasons; the typical mail server that PHP is set to use on an average third party hosted web server, is almost never, never setup the way you would wan't a mass emailing mail server to be setup. Maybe 3 -4 years ago, I would have spent the time to craft a solution but there are way too many alternatives available today. Additionally, with the CAN SPAM Act, it pays to use a service designed to handle mass mailing. Google: Constant Contact Aweber iContact MailChimp Quote Link to comment https://forums.phpfreaks.com/topic/251265-problem-when-sending-mail-to-over-3-500-people-at-a-time/#findComment-1288906 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.