PHP mail()函数不能发送到hotmail? [英] PHP mail() function cannot send to hotmail?

查看:97
本文介绍了PHP mail()函数不能发送到hotmail?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我在互联网上搜索过的答案 - 可惜没有用。我正在尝试使用PHP mail()函数发送邮件,所以成员可以按照链接注册。它适用于Gmail,Yahoo !,而不适用于Hotmail。请帮助我!!!

 <?php 
$ headers。='To:< kenny.XXX @ hotmail.com>'。 \r\\\
;
$ headers。='From:< XXX@srv30.000webhost.com>'。 \r\\\
;
$ headers。='Cc:XXX@srv30.000webhost.com'。 \r\\\
;
$ headers。='Bcc:XXX@srv30.000webhost.com'。 \r\\\
;
$ text =hello;
$ text = str_replace(\\\
。,\\\
..,$ text);
邮件('肯尼·沃恩:< kenny.XXX@hotmail.com>','雷神领域帐号验证!'$文本$标题)
?>

如果这有助于任何人:



SMTP :localhost(srv30.000webhost.com)



SMTP PORT:25

解决方案

你的代码似乎很好。我的猜测是,您的服务器端有问题,检查邮件发送日志或让您的服务器管理员为您查看。可能是路由/ dns问题。



编辑:
我刚刚尝试在我的服务器上的脚本,它的工作正常。立即在我的hotmail地址上收到邮件。


Okay, I have searched on the internet for answers- sadly to no avail. I'm trying to send mail using the PHP mail() function so members can follow the link to register. It works for Gmail, Yahoo!, but not for Hotmail. Please help meh!!!

   <?php
$headers .= 'To: <kenny.XXX@hotmail.com>' . "\r\n";
$headers .= 'From: <XXX@srv30.000webhost.com>' . "\r\n";
$headers .= 'Cc: XXX@srv30.000webhost.com' . "\r\n";
$headers .= 'Bcc: XXX@srv30.000webhost.com' . "\r\n";
$text="hello";
$text = str_replace("\n.", "\n..", $text);
mail('Kenny Worden:<kenny.XXX@hotmail.com>','Leos Realm account verification!',$text,$headers);
?>

If this helps anyone:

SMTP : localhost(srv30.000webhost.com)

SMTP PORT: 25

解决方案

Your code seems to be good. My guess is that there is something wrong at your servers end, check mail delivery logs or have your server admin look at them for you. Could be a routing/dns issue.

edit: i just tried that script on my server and it works well. immediately got email on my hotmail address.

这篇关于PHP mail()函数不能发送到hotmail?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆