PHP的mail()函数在GoDaddy专用服务器上不起作用 [英] PHP's mail() function doesn't work on GoDaddy dedicated server

查看:178
本文介绍了PHP的mail()函数在GoDaddy专用服务器上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由GoDaddy在虚拟专用平台上托管的网站,而且我无法获得 mail()功能在我的PHP脚本。当我们首次注册到我的网站时,我试图向人们发送带有验证码的电子邮件,而 mail()功能对Gmail地址非常有用,但不是其他的AOL甚至GoDaddy的电子邮件服务!



我尝试和多个GoDaddy支持代表聊天,但是在这个问题上并没有太大帮助。我在网路上看过,似乎这是在GoDaddy上托管他们的网站的人很常见的问题。我的电子邮件失败时不会弹回电子邮件,所以很难知道发生了什么。



这是我的PHP代码:

  $ sendtoemail ='newsignup@aol.com'; 
$ emailsubject =请验证您的电子邮件;
$ emailbody =验证信息,blah blah。
$ emailheader ='From:admin@example.com'。 \\\\。
'X-Mailer:PHP'。 \\\\。
'Reply-To:admin@example.com'。 \\\\。
'-fadmin@example.com';
mail($ sendtoemail,$ emailsubject,$ emailbody,$ emailheader);

当我查看 / usr / local / psa / var / log / maillog (通过PuTTY SSH访问),全部结束于:延期:./Maildir:_No_such_file_or_directory /



我还在我的主机帐户上激活了反向DNS,并创建了一个SPF DNS记录,通过GoDaddy发送电子邮件,并检查了包含PTR框进行DNS查找。这是GoDaddy的DNS管理器上的区域文件编辑器的TXT(文本)部分。 (希望对你来说比对我更有意义)。

解决方案

我不知道GoDaddy是否支持PHP Mail,这通常是网络托管公司的一个大问题,因为它在脚本中用于发送垃圾邮件。



最好的事情是检查PEAR扩展GoDaddy在那里的托管,如果他们有PEAR邮件,你可以使用它。如果没有,那么您应该尝试使用经过身份验证的邮件发送。



如果需要,我可以给您一个PEAR和已验证邮件的示例。


I have a website that is hosted by GoDaddy on a virtual dedicated platform, and I haven't been able to get the mail() function to work properly in my PHP script. I'm trying to send emails with validation codes to people when they first sign up to my website, and the mail() function works great for Gmail address, but not others like AOL or even GoDaddy's email service!

I tried talking with multiple GoDaddy support reps but they weren't really helpful on the issue. I've looked around online and it seems like this is a very common problem with people who are hosting their websites on GoDaddy. I'm not getting bounce back emails when I the emails fail so it's hard to know what's going on.

Here is my PHP code:

$sendtoemail  = 'newsignup@aol.com';
$emailsubject = "Please validate your email";
$emailbody    = "Validation info, blah blah.";
$emailheader  = 'From: admin@example.com' . "\r\n" . 
                'X-Mailer: PHP' . "\r\n" . 
                'Reply-To: admin@example.com' . "\r\n" . 
                '-fadmin@example.com'; 
mail($sendtoemail, $emailsubject, $emailbody, $emailheader);

I've gotten a few errors when I checked /usr/local/psa/var/log/maillog (accessed through PuTTY SSH) that all ended in: deferral: ./Maildir:_No_such_file_or_directory/

I have also activated reverse DNS on my hosting account and created an SPF DNS record that sends email through "GoDaddy only" and checked the "Include PTR" box for DNS lookup. This was under the "TXT (text)" section of the "Zone File Editor" on GoDaddy's DNS manager. (Hopefully that makes more sense to you than it does to me).

解决方案

I am not sure if GoDaddy support PHP Mail, this is usually a big problem for web hosting companies because its used in scripts to send spam.

The best thing to do is check what PEAR extensions GoDaddy have on there hosting, if they have PEAR mail, you can use that. If not, then you should try using authenticated mail sending.

I can give you an example of PEAR and Authenticated mail if you need.

这篇关于PHP的mail()函数在GoDaddy专用服务器上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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