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");
}
}

?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.