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. Quote Link to comment 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/ Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.