webserver – Php Mail转发收件人垃圾邮件/垃圾文件夹
我在我的大学网站工作.我写了一个php脚本,它使用php邮件功能发送电子邮件.但问题是,我发送的所有电子邮件都会进入收件人垃圾邮件/垃圾文件夹.
为了解决它: 我尝试了stackoverflow和serverfault网站中类似问题的所有步骤和答案. 这是用于发送电子邮件的PHP代码: <?php $from_address="webmaster@".$_SERVER['SERVER_NAME']; $from_name="webmaster"; $headers = "MIME-Version: 1.0rn" ."Content-Type: text/plain; charset=utf-8rn" ."Content-Transfer-Encoding: 8bitrn" ."From: =?UTF-8?B?". base64_encode($from_name) ."?= <$from_address>rn" ."X-Mailer: PHP/". phpversion(); $subject="Web Mail Testing"; $body="This is test Message"; $to="riteshkumargupta1990@gmail.com"; mail($to,$subject,$body,$headers,"-fwebmaster@{$_SERVER['SERVER_NAME']}"); echo "The Mail is SuccessFully Sent to :".$to; ?> 我还附上原始电子邮件(我在我的Gmail帐户中收到的“riteshkumargupta1990@gmail.com”) Delivered-To: riteshkumargupta1990@gmail.com Received: by 10.204.8.210 with SMTP id i18csp146000bki; Wed,21 Nov 2012 20:58:12 -0800 (PST) Received: by 10.68.219.164 with SMTP id pp4mr1119127pbc.72.1353560291776; Wed,21 Nov 2012 20:58:11 -0800 (PST) Return-Path: <webmaster@nitw.ac.in> Received: from www.nitw.ac.in (www.nitw.ac.in. [218.248.13.200]) by mx.google.com with ESMTPS id sh10si3456960pbb.293.2012.11.21.20.58.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed,21 Nov 2012 20:58:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of webmaster@nitw.ac.in designates 218.248.13.200 as permitted sender) client-ip=218.248.13.200; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of webmaster@nitw.ac.in designates 218.248.13.200 as permitted sender) smtp.mail=webmaster@nitw.ac.in Received: from www.nitw.ac.in (localhost.localdomain [127.0.0.1]) by www.nitw.ac.in (8.13.8/8.13.8) with ESMTP id qAM50M0h016190 for <riteshkumargupta1990@gmail.com>; Thu,22 Nov 2012 10:30:23 +0530 Received: (from nobody@localhost) by www.nitw.ac.in (8.13.8/8.13.8/Submit) id qAM50McG016189; Thu,22 Nov 2012 10:30:22 +0530 Date: Thu,22 Nov 2012 10:30:22 +0530 Message-Id: <201211220500.qAM50McG016189@www.nitw.ac.in> X-Authentication-Warning: www.nitw.ac.in: nobody set sender to webmaster@nitw.ac.in using -f To: riteshkumargupta1990@gmail.com Subject: Web Mail Testing X-PHP-Originating-Script: 0:mailer.php MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: =?UTF-8?B?d2VibWFzdGVy?= <webmaster@nitw.ac.in> X-Mailer: PHP/5.3.5 This is test Message 此外,谷歌搜索时发现这种问题的不常见原因是服务器黑名单. 然后我使用以下工具来测试它:http://www.mxtoolbox.com/SuperTool.aspx?action=mx%3anitw.ac.in# 当上面的工具测试发现我的服务器在黑名单中时,我感到震惊.这是怎么回事?因为我上面附上的原始邮件说“:Received-SPF:pass(google.com:webmaster@nitw.ac.in域名的最佳猜测记录,指定218.248.13.200为允许的发件人) 此外,如果我的服务器被列入黑名单,那么我如何找到黑名单的原因以及如何解决它? UPD: 谢谢! 解决方法
设置SMTP服务器是一项棘手且繁琐的任务,除非你的工作日复一日地进行..,检查你的服务器SSL证书是否使用授权的CA证书正确签名.有时候它可能是自我的问题签署证书.,
或者你也可以试用Gmail作为你的SMTP服务器解决了很多问题..,Link (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- phpmailer绑定邮箱的实现方法
- php – CodeIgniter / jQuery – 分页 – 无尽的分页
- php – in_array()如果??使用explode()创建数组,则不再按预
- 如何使用PHP加密数据库中的密码数据?
- Discuz! 5.0.0论坛程序中加入一段js代码,让会员点击下载附
- php – SilverStripe 3.1删除SortableGridField pagnation并
- springMVC源码--Controller控制器
- php带抄送和密件抄送的邮件发送方法
- php – 使用编辑按钮单击在bootstrap模式中显示特定的行数据
- php array_intersect 计算数组的交集