Hi,
I have an external html file that contains a message to be sent to around 200 people, who's emails are stored in a MySQL db. I import the message into a variable using:
$handle = fopen ("message.htm", "r");
while (!feof ($handle)) {
$buffer .= fgets($handle, 4096);
}
fclose ($handle);
$message = $buffer;
can I then send that like this:
mysql_connect("mysql","username","password");
mysql_select_db("mailList");
$sql = "SELECT * FROM mailList";
$result = mysql_query($sql);
if ($result) {
while ($row = mysql_fetch_array($result)) {
mail($row["email"], $subject, $message, $headers);
}
}else{
// error
}
...or do I have to do something to prevent a timeout? Or is there just a better way of doing the whole thing?
Thanks
Ste