Reputation: 11
I have an issue using PHP to send mail only to Microsoft domains (outlook,live,hotmail). It works fine with all others.
This is my PHP Script.
<?php
$subject2 = 'Registration Request';
$headers2 .= "MIME-Version: 1.0\n";
$headers2 .= "Content-Type: text/html; charset=ISO-8859-1\n";
$headers2 .= 'X-Mailer: PHP/' . phpversion();
$message2 = '<html><body>';
$message2 .= '<h1>New Account Request</h1><br>';
$message2 .='<table border="0" cellpadding="5" cellspacing="0"><tr><td>';
$message2 .= 'Name</td><td>'.$this->_user['fname'].' '.$this->_user['lname'].'</td></tr>';
$message2 .= '<tr><td>User ID</td><td>'.$this->_user['user'].'</td></tr>';
$message2 .= '<tr><td>Company</td><td>'.$this->_user['company'].'</td></tr>';
$message2 .= '<tr><td>Email</td><td>'.$this->_user['email'].'</td></tr>';
$message2 .= '<tr><td>Telephone</td><td>'.$this->_user['telephone'].'</td></tr></table>';
$message2 .= '<br>Thanks<br><a href="http://precent.ch">precent.ch</a>';
$message2 .= '</body></html>';
$too = '[email protected]';
$mailed = mail($too,$subject2,$message2,$headers2);
if($mailed)
{
header('location: index.html?thanks');
}
?>
Thanks
Upvotes: 1
Views: 3135
Reputation: 33
It's not a PHP problem. Those bad mail providers make use of non standard aggressive anti spam policies that silently drop incoming emails.
You should call your sysadmin and let him check the MTA on your PHP servers. Usualy it's a better solution to use the MTA relay given by your PHP Internet Service Provider instead of using a standalone MTA like sendmail on your PHP server machine.
This may give you more info:
Can't send mails to only Hotmail. (gmail, etc. works perfectly) Encoding problems when sending email with PHP to Hotmail PHP mail() function cannot send to hotmail?
Upvotes: 2