Hi,
I'm new to these forums, so I hope I'm putting my question in the right place. Anyhow I've had a simple PHP email function that I've been using for a while, but I discovered today that it appears that emails sent using this function don't arrive when sent to @btinternet.com addresses. Gmail however receives them fine. I find this strange, as the mail function appears to return correctly, so it's definitely being sent. However the email is not being put into spam or even moved to trash, it simply doesn't arrive. I've also added the "Return-path" parameter to the header in the hopes of getting an error from the server, but I never receive anything back indicating that anything has gone wrong.
For testing, I've pulled my code out into its own page which contains only the following (except with real email addresses).
<?php
function email($to, $subject, $message, $from)
{
$headers = "From: $from\r\nReturn-path: $from\r\nMIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\n";
$message = wordwrap($message, 70);
return mail($to, stripslashes($subject), stripslashes($message), $headers);
}
if (email("
[email protected]", "Testing...", "This is a test email...", "
[email protected]"))
echo "Sent OK.";
else
echo "Send failed.";
?>
This code works fine when I send to a Gmail address, but when I send to a btinternet address (I've tried 2), as I described, it just never arrives.
I've been trying all kinds of things, like changing between "\r\n" and "\n" for the headers, changing the content type, adjusting the word wrap etc., but nothing helps the problem. I've also checked my website's IP to see if it's been blacklisted (I'm on shared web hosting), but it appears to be fine. For the record, my web host is 123-Reg. I was wondering whether anyone has encountered anything like this before, and if you have any suggestions for what else I might try?
Thanks in advance!
Laurie