I just tried to email a addresses from a database.
The script I used worked for a list of approx. 15 addresses.
I put in-house email addresses at the beginning and end of database. The operation timed-out when ran from the browser.
The first address received it but the last address did not.
Is there any way to run the php script so that it won't time-out?
Here is the php I used:
<?
$headers = "From: Test <test@arbitrary.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$subject = "HTML Email via PHP/mySQL";
// Query
include('/db connection script');
$query = "SELECT * FROM emaillist";
$result = @($query,$conn) or die("Query Failed");
$i = 0;
while ($row = mysql_fetch_array($result)) {
$first = $row['firstname'];
$to = $row['email'];
$i++;
// Message
$message = '
<html>
<head>
<title>Html Message</title>
<style type="text/css">
<!--
BODY {font-size: 11pt;
font-family: arial, Tahoma, verdana;
}
.redbold {font-size: 13pt;
font-weight: bold;
color: red;
font-family: Tahoma, arial, verdana;}
.bold {font-size: 12pt;
font-weight: bold;}
-->
</style>
</head>
<body>
Dear '.$first.':
<p>Message Body....
</body>
</html>
';
// Send It
mail($to, $subject, $message, $headers);
}
echo $i," Emails Sent";
?>