php mail()函数发送到Gmail时发生550-5.1.1错误

时间:2015-01-30 08:17:58

标签: php email

我使用Mac 10.8和XAMPP运行表单,我尝试通过php mail()函数向我的Gmail邮箱发送电子邮件。

Postfix已经过检查并正常工作!

date | mail -s testing mymail@gmail.com

但如果我使用php mail()函数向我发送电子邮件,gmail会向我发送一封发送失败的电子邮件,问题550-5.1.1

这是我的PHP代码:

<?php
$message = "Line 1\r\nLine 2\r\nLine 3";
$message = wordwrap($message, 70, "\r\n");
mail('mymail@gmail.com', 'My Subject', $message);
?>

这就是gmail发给我的信息:

title:Mail Delivery Subsystem <mailer-daemon@googlemail.com> 

Delivery to the following recipient failed permanently:

     mymail@gmail.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain gmail.com by gmail-smtp-in.l.google.com. [2607:f8b0:400e:c02::1b].

The error that the other server returned was:
550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 o12si11969504pdn.152 - gsmtp


----- Original message -----

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=from:to:subject:message-id:date;
        bh=1AZ/Vdb1mK5udozgCTqYHYBC0R96S28pMQasydnvT/I=;
        b=KXoej9FmENjmiqxrVptCO9Zr7cWh0/1b6BnkA6NXZHGNLikjg4zJtnQVeQ+XxdY2zn
         BQnamlxu7JkztxwpzE0IKwtOTtQ9nDWzbfCMLsQqN98j5YP+1JGLBiO4sMEMpzMdtImo
         Ds4FWQZbWwUrj4nXT+UCEqYwfAi7hO8l8Rs4khfQoJ8Si4lmsBDZSiox/+INPjch5o+o
         J/hEM1ca5w8HOHxm3Y9/0dGR3wwRFMFHYtYgFKZHciCUYDnbSsI9RgeDjyH/J/4qHIq6
         FZQj3kclZmGJ52ZOljH9ZVl63w2X7q62NVA3KD7loRg7JqyJXPMI6Mqa4hJMKh6c1hjX
         2fMQ==
X-Received: by 10.69.26.233 with SMTP id jb9mr1528710pbd.38.1422603920137;
        Thu, 29 Jan 2015 23:45:20 -0800 (PST)
Return-Path: <mymail@gmail.com>
Received: from maccomputer (221-165-70-176.HINET-IP.hinet.net. [221.165.70.176])
        by mx.google.com with ESMTPSA id g6sm9830721pdo.76.2015.01.29.23.45.19
        for <mymail@gmail.com>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Thu, 29 Jan 2015 23:45:19 -0800 (PST)
From: System Services <mymail@gmail.com>
X-Google-Original-From: daemon@maccomputer.localdomain (System Services)
Received: by maccomputer (Postfix, from userid 1)
        id 0CED22A70F6; Fri, 30 Jan 2015 15:45:18 +0800 (CST)
To: mymail@gmail.com
Subject: My Subject
X-PHP-Originating-Script: 501:text.php
Message-Id: <20150130074518.0CED22A70F6@maccomputer>
Date: Fri, 30 Jan 2015 15:45:18 +0800 (CST)

Line 1
Line 2
Line 3

有谁知道如何修复它?

我是否需要在计算机中设置任何内容?

但是postfix已设置并且命令有效!

0 个答案:

没有答案