简体   繁体   English

PHP mail()和hotmail

[英]PHP mail() and hotmail

I'm launching a product today and COMPLETELY OUT OF NOWHERE hotmail accounts can't receive email from my php mail() script. 我今天要发布产品,并且Hotmail帐户完全无法从我的php mail()脚本接收电子邮件。

I've searched around and found others with similar problems but haven't found a true solution 我四处搜寻,发现其他有类似问题的人,但没有找到真正的解决方案

$Email = "my@email.com";
$Name = "My name";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: ". $Name . " <" . $Email . ">\r\n";
$body = "bleh";

mail($recipient, "My email", $body, $headers);

It sends fine to GMail etc just not hotmail. 它可以正常发送到GMail等,而不是hotmail。

Anyone conquered a similar problem? 有人征服过类似的问题吗? It doesn't go into SPAM either 它也不会进入垃圾邮件

Try to use SMTP instead. 尝试改用SMTP。 Mails from mail() often go to spam folder, because servers can't verify source of message. 来自mail()的邮件通常进入垃圾邮件文件夹,因为服务器无法验证邮件来源。

Is this the exact code you're using? 这是您使用的确切代码吗?

A long shot, but could there be a conflict in your e-mail validation (if there is one)? 远射,但您的电子邮件验证是否可能有冲突(如果有)? A while ago I had an issue where regex wasn't catching hotmail accounts, took me so long to figure it out. 不久前,我遇到了一个问题,即正则表达式无法捕获hotmail帐户,花了我很长时间才弄清楚。

Else, I agree with other responders that some mail services simply delete what they think is spam, I think there's a "spam level" thing where you set how aggressive the spambot is. 另外,我同意其他响应者的观点,即某些邮件服务只是删除他们认为是垃圾邮件的邮件,我认为有一种“垃圾邮件级别”的东西可以让您设置垃圾邮件机器人的攻击性。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM