Jump to content

problem when sending mail to over 3-500 people at a time


CodeDome

Recommended Posts

hey there i am new on this forum :P 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");
}
}

?>

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.