Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ubuntu中通过php脚本发送邮件_Php_Linux_Email - Fatal编程技术网

在ubuntu中通过php脚本发送邮件

在ubuntu中通过php脚本发送邮件,php,linux,email,Php,Linux,Email,我试图通过ubuntu中的php脚本向我的gmail id发送邮件,但无法发送。 我的代码 输出/var/log/mail.log Jul 27 11:09:59 ak-VirtualBox postfix/smtp[5598]: 7069320869: to=<abc@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.129.26]:25, delay=4.9, delays=0.08/0.08/2.9/1.8, dsn=5.7

我试图通过ubuntu中的php脚本向我的gmail id发送邮件,但无法发送。 我的代码

输出/var/log/mail.log

Jul 27 11:09:59 ak-VirtualBox postfix/smtp[5598]: 7069320869: to=<abc@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.129.26]:25, delay=4.9, delays=0.08/0.08/2.9/1.8, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[74.125.129.26] said: 550-5.7.1 [14.98.28.24      12] Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. kr8si13914201pbc.32 - gsmtp (in reply to end of DATA command))
Jul 27 11:09:59 ak-VirtualBox postfix/cleanup[5596]: 4AA162086D: message-id=<20140727053959.4AA162086D@ak-VirtualBox>
Jul 27 11:09:59 ak-VirtualBox postfix/qmgr[4781]: 4AA162086D: from=<>, size=2908, nrcpt=1 (queue active)
Jul 27 11:09:59 ak-VirtualBox postfix/bounce[5606]: 7069320869: sender non-delivery notification: 4AA162086D
Jul 27 11:09:59 ak-VirtualBox postfix/qmgr[4781]: 7069320869: removed
Jul 27 11:09:59 ak-VirtualBox postfix/local[5608]: 4AA162086D: to=<daemon@ak-VirtualBox>, relay=local, delay=0.12, delays=0.06/0.01/0/0.05, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 27 11:09:59 ak-VirtualBox postfix/qmgr[4781]: 4AA162086D: removed
Jul 27 11:09:59 ak VirtualBox postfix/smtp[5598]:7069320869:to=,relay=gmail smtp in.l.google.com[74.125.129.26]:25,delay=4.9,delay=0.08/0.08/2.9/1.8,dsn=5.7.1,status=bounched(主机gmail smtp in.l.google.com[74.125.129.26]表示:550-5.7.1[14.98.28.24]我们的系统检测到此邮件可能是550-5.7.1未经请求的邮件。为了减少发送到Gmail的垃圾邮件数量,550-5.7.1此邮件已被阻止。请访问550-5.7.1http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 有关550 5.7.1更多信息,请参见kr8si13914201pbc.32-gsmtp(回复数据结束命令))
7月27日11:09:59 ak VirtualBox后缀/清除[5596]:4AA162086D:消息id=
7月27日11:09:59 ak VirtualBox后缀/qmgr[4781]:4AA162086D:from=,size=2908,nrcpt=1(队列活动)
7月27日11:09:59 ak VirtualBox后缀/跳出[5606]:7069320869:发件人未送达通知:4AA162086D
7月27日11:09:59 ak VirtualBox后缀/qmgr[4781]:7069320869:已删除
7月27日11:09:59 ak VirtualBox后缀/本地[5608]:4AA162086D:to=,中继=本地,延迟=0.12,延迟=0.06/0.01/0/0.05,dsn=2.0.0,状态=已发送(已发送到邮箱)
7月27日11:09:59 ak VirtualBox后缀/qmgr[4781]:4AA162086D:已删除
当我提交表格时,它会显示电子邮件发送(按照我的脚本),但我无法收到gmail id中的任何电子邮件。是否有我缺少的配置和安装


如果您能在第一行提供任何帮助,我们将不胜感激,日志特别指出:

我们的系统检测到此邮件可能是550-5.7.1封未经请求的邮件。为了减少发送到Gmail的垃圾邮件数量,550-5.7.1此邮件已被阻止。请访问550-5.7.1http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 欲了解更多信息,请参阅5.7.1。kr8si13914201pbc.32-gsmtp(回复数据结束命令))

Gmail(和大多数其他邮件服务)综合使用发送域信誉、邮件传输/发送服务器状态(黑名单等)、请求频率、收件人数量和邮件内容来确定邮件是否为垃圾邮件


如果确定不是,它会将其发送到收件箱,如果是中等严重性,它会将其路由到垃圾邮件文件夹。如果评级真的很低,它会阻止邮件-就像您的情况一样。

服务器上的DNS是否正确转发和反转?如果不是,这将解释为什么来自服务器的邮件被视为垃圾邮件


若要查看您的邮件服务器是否存在导致其他邮件服务器认为它是垃圾邮件发送者的明显问题,请尝试从您的邮件服务器发送邮件进行检查-auth@verifier.port25.com. 此服务将执行一系列检查,您将收到一份包含大量信息的报告,例如邮件服务器的DNS是否正确设置,邮件服务器的IP是否在任何黑名单上,如果您的SPF记录有问题,等等。

您在
/var/log/maillog
中看到了什么?和。。您已经用ubto标记了这个问题,并且提到了ubto,但是您的配置提到了
php\u openssl.dll
。您还包括了仅限Windows和仅限Unix的php.ini邮件配置。您真正运行的是什么操作系统?请尝试类似以下内容,而不是25@ghoti更新了我的问题,我的virtualbox中安装了Ubuntu14,安装在Windows8(主机)@Spencex,但我的Inbox中仍然没有任何内容。。。看起来您发布的日志的第一行包含解释。
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP=localhost
; http://php.net/smtp-port
smtp_port=25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = 

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path ="/usr/sbin/sendmail -t -i"

extension=php_openssl.dll //removed semicolon
Jul 27 11:09:59 ak-VirtualBox postfix/smtp[5598]: 7069320869: to=<abc@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.129.26]:25, delay=4.9, delays=0.08/0.08/2.9/1.8, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[74.125.129.26] said: 550-5.7.1 [14.98.28.24      12] Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. kr8si13914201pbc.32 - gsmtp (in reply to end of DATA command))
Jul 27 11:09:59 ak-VirtualBox postfix/cleanup[5596]: 4AA162086D: message-id=<20140727053959.4AA162086D@ak-VirtualBox>
Jul 27 11:09:59 ak-VirtualBox postfix/qmgr[4781]: 4AA162086D: from=<>, size=2908, nrcpt=1 (queue active)
Jul 27 11:09:59 ak-VirtualBox postfix/bounce[5606]: 7069320869: sender non-delivery notification: 4AA162086D
Jul 27 11:09:59 ak-VirtualBox postfix/qmgr[4781]: 7069320869: removed
Jul 27 11:09:59 ak-VirtualBox postfix/local[5608]: 4AA162086D: to=<daemon@ak-VirtualBox>, relay=local, delay=0.12, delays=0.06/0.01/0/0.05, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 27 11:09:59 ak-VirtualBox postfix/qmgr[4781]: 4AA162086D: removed