I don't know why this doesn't work but my mailing list script does not send to hotmail addresses. However I have another script which sends a quote to one email address. This is located on the root of my 'Public_html' folder while this one is located within a sub folder of my 'public_html' folder.
Could this be a script problem or maybe a server problem?
Here is some of my code:
require_once ('../../mysql_connect.php');
if (isset($_POST['submit'])) {
$message = NULL;
if ($_POST['emailto'] == 'live'){
$query_users = "SELECT * FROM emails";
echo '<p>Email sent status: <b>Live</b></p>';
} elseif ($_POST['emailto'] == 'test'){
$query_users = "SELECT * FROM emails_test";
echo '<p>Email sent status: <b>Test</b></p>';
}
$res_users = mysql_query ($query_users);
while ($row_users = mysql_fetch_array($res_users, MYSQL_NUM)){
$id = $row_users[0];
$to = $row_users[1];
echo $to.'<br>';
if ($row_users[2] != NULL){
$fn = 'Hi '.$row_users[2].',';
} else {
$fn = 'Hi,';
}
if(!empty($_POST['subject'])){
$subject = $_POST['subject'];
} else {
$subject = "Newsletter: ".date('jS M, Y', time());
}
$body = '
<p>'.$fn.'</p>
<p>'.stripslashes($_POST['comments']).'</p>
<p>
<pre>
</pre>
</p>';
$email_header = "From: [email]info@someone.co.uk[/email]\r\n";
$email_header .= "MIME-Version: 1.0\r\n";
$email_header .= "Content-Type: text/html\r\n";
$email_header .= "charset: iso-8859-1";
mail ($to, $subject, $body, $email_header);
} // End of While Loop
} // End of the main Submit conditional.
// Print the error message if there is one.
if (isset($message)) {
echo '<font color="#FFFF33">', $message, '</font>';
}
?>
<form action="<?php echo $SERVER['PHP_SELF']; ?>" method="post">
<table cellpadding="5" cellspacing="5" border="0" class="tableborderALL">
<tr>
<td align="right" width="30"><b>Subject:</b></td>
<td align="left"><input name="subject" type="text" value="<?php
if(isset($POST['subject'])){
echo $POST['subject'];
} else {
echo $subject;
}
?>" size="50" maxlength="70"></td>
</tr>
<tr>
<td align="right" width="30"><b>Body:</b></td>
<td align="left"><textarea name="comments" rows="10" cols="40">
<?php
if(isset($POST['comments'])){
echo $_POST['comments'];
}
?>
</textarea></td>
</tr>
<tr>
<td align="center" colspan="2" class="admin_grn">
<input name="emailto" type="radio" value="test" checked />Test :: Live<input name="emailto" type="radio" value="live" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Send to Subscribers" onKeyDown="enter" class="admin_buttons" />
</td>
</tr>
</table>
</form>
<?php
include ('../includes/admin_footer.php');
?>