Jump to content

sending newsletter


jcombs_31

Recommended Posts

Ok, so I've only used the mail function for sending contact forms, quotes, etc.  Usually sending to just 1 or 2 recipients.  I'm setting up my first newsletter service that the client can use to send out site updates/news, etc.  I started out thinking this should be quite simple, set it up like a contact form and send it to my list stored in the mysql DB.  But, my question is about when the list becomes quite big, would this cause problems with the script execution time?  Any thoughts or concerns I should be aware of in creating this?

Link to comment
https://forums.phpfreaks.com/topic/49295-sending-newsletter/
Share on other sites

Execution time isn't much of a problem, but 'flooding' the mailserver might be. You can avoid mailserver problems by including a counter and adding a short nap every n messages ....

 

mail( .....);
$mc++;
if ($mc==20) {
    $mc = 0;
    sleep(1); // nap for a sec
}
.... 

Link to comment
https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-241957
Share on other sites

The better way is probably to out the addressees in the BCC field and [email protected] in the to field.  There are some restrictions on how many addresses can be in bcc (I'm sure). Depending on how many addressees you have, you could probably send mails out bcc'd to groups of 20 at a time with the occasional sleep()

Link to comment
https://forums.phpfreaks.com/topic/49295-sending-newsletter/#findComment-242272
Share on other sites

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.