isedeasy Posted December 2, 2010 Share Posted December 2, 2010 I have created a mailing list where users can sign-up with their name and email address. I know have a mysql table with columns `name`, `email` and `key` (random string for unsubscription). My question is, whats the best way to send off the emails? I want to send off daily emails which get the content from a dynamic php page. Link to comment https://forums.phpfreaks.com/topic/220465-mailing-list/ Share on other sites More sharing options...
JonnoTheDev Posted December 2, 2010 Share Posted December 2, 2010 Use a SMTP mail server to do the sending. Do not use the php mail() function in a huge loop. Look at the following library: http://swiftmailer.org/ Link to comment https://forums.phpfreaks.com/topic/220465-mailing-list/#findComment-1142287 Share on other sites More sharing options...
isedeasy Posted December 6, 2010 Author Share Posted December 6, 2010 Each email needs to send a unique key so how do I send individual emails with out looping? I currently us PHPMailer class to send emails via smtp would I be able to use that? Sorry if I sound like a n00b but this is all new to me. Link to comment https://forums.phpfreaks.com/topic/220465-mailing-list/#findComment-1143592 Share on other sites More sharing options...
JonnoTheDev Posted December 7, 2010 Share Posted December 7, 2010 Each email needs to send a unique key so how do I send individual emails with out looping? I currently us PHPMailer class to send emails via smtp would I be able to use that? Sorry if I sound like a n00b but this is all new to me. What I meant was not to use the mail() function within a loop i.e foreach($addresses as $email) { mail($email, 'subject', 'body', $headers); } Quote from php.net 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. http://uk.php.net/manual/en/function.mail.php PHPMailer is suitable. Also PEAR Mail http://pear.php.net/package/Mail Link to comment https://forums.phpfreaks.com/topic/220465-mailing-list/#findComment-1143926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.