Hi,
I have a table in a mysql database containing email addresses of contacts. I'm building a mailing list, which sends an email to everyone in the table. My code is along the lines of :
// find members in db
$res = mysql_query("SELECT email FROM member_tbl");
$numrows = mysql_num_rows($res);
// are there any?
if ($numrows > 0) {
while ($row = mysql_fetch_array($res)) {
$email_to = $row["email"];
// email member the newsletter
$email_subject = "www.domain.com";
$email_message = "$newsletter\r\n\r\n";
mail($email_to, $email_subject, $email_message, "From: news@domain.com\nReply-To: news@domain.com");
}
}
my question is - is this a suitable way to send bulk email? as the number of records in the table increases, will the server struggle to cope? It's a bit awkward because I can't send email from my development server so I can't really test performance.
If there is a more efficient method to send bulk email, I would be grateful for the advice.
cheers.