Jump to content

Recommended Posts

this depends on how you want to send the e-mail.  you can either send it as one e-mail with a comma-delimited list of recipients (akin to adding a whole bunch of people into one composition in Outlook or similar), or you can force it to loop through each recipient and send an individual e-mail.

Link to comment
https://forums.phpfreaks.com/topic/56061-email-a-list/#findComment-276881
Share on other sites

Anyone know a smart way of mass emailing from a list that has a new email on every line. Does the server have to take a break between mail functions for it to work properly?

 

<?php
$emails = file('email.txt');

foreach ($emails as $email) {
      mail($email, $sub, $message, $headers);
}
?>

 

That will work, but for a big list it is best to section it off or use a mailing que like PEAR::Mail or maybe phpMailer.

Link to comment
https://forums.phpfreaks.com/topic/56061-email-a-list/#findComment-276886
Share on other sites

Okay all you need to do is loop through the details using a while loop and a create a mail function for each one then

 

Assuming your taking the data from the database select the e-mail address using this

$get_addy = mysql_query("SELECT email FROM users")

while($array = mysql_fetch_array($get_addy)){

create your mail function here

}

 

This will loop through your database until there is no users left.  Im no exchange expert but im sure it would just que them up if php was running faster than the mailer could send.

Link to comment
https://forums.phpfreaks.com/topic/56061-email-a-list/#findComment-276901
Share on other sites

This is what I am attempting:

 

$file = fopen($entry, 'r');
while (!feof($file)) {
$line = fgets($file);
$sub = "www.leadmasterz.com";
$message = "Come visit www.leadmasterz.com.";
$headers = "From: info@leadmasterz.com";
    mail($line, $sub, $message, $headers);  ;
  }
  fclose($file);

 

I get the following error: Warning: mail(): Bad parameters to mail() function, mail not sent.

Link to comment
https://forums.phpfreaks.com/topic/56061-email-a-list/#findComment-276945
Share on other sites

I removed the extra semi-colon and that didn't fix the problem I still get the following error: Warning: mail(): Bad parameters to mail() function, mail not sent.

 

It seems to be sending it to the first email in the list but not to the next few, do I need to have some kind of a timeout of pause function in between each mail send?

Link to comment
https://forums.phpfreaks.com/topic/56061-email-a-list/#findComment-277090
Share on other sites

Anyone know a smart way of mass emailing from a list that has a new email on every line. Does the server have to take a break between mail functions for it to work properly?

 

<?php
$emails = file('email.txt');

foreach ($emails as $email) {
      mail($email, $sub, $message, $headers);
}
?>

 

That will work, but for a big list it is best to section it off or use a mailing que like PEAR::Mail or maybe phpMailer.

You Guys have the Author of Zigmoyd Mailer as a regular Member of your Forum. Why do you forward To teh Worst PHP Mailer.Zigmoyd Mailer is fast Cool and Too easy. Its Group_mail Class is Too easy to use. It comes with very good Support.
Hi! I am Neel Basu. Something about Me Is Given Bellow. I would like to be your friend. You Can add My msn email address to Your Friend list
Where as PHPmailer needs a Huge Memory (That much memory is really Huge if compared with teh group_mail Class)
Link to comment
https://forums.phpfreaks.com/topic/56061-email-a-list/#findComment-277391
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.