【问题标题】:Sending mail from PHP - is the error at my end, or the Mail Server's?从 PHP 发送邮件 - 是我的错误还是邮件服务器的错误?
【发布时间】:2012-01-15 00:24:24
【问题描述】:

我正在尝试从我的 PHP 脚本通过 SMTP 发送电子邮件,通过 CodeIgniter 运行。

调试输出见下文。这是否表明我的 PHP (Unable to send email using PHP SMTP) 或他们的末尾 (hello: 250-parrot.email-provider.co.uk - 这意味着我已经连接到他们的服务器,因为我输入的实际 SMTP 服务器是 mail2.email-provider.co.uk,所以它似乎连接并重定向到这个parrot 东西)。

我已确认我的 SMTP 详细信息是正确的,但它仍然说它无法验证密码 - 即使这个相同的密码在我的本地邮件客户端中有效。

我已经更改了我的网站名称和提供商的名称(如果是我的错,我不想点名羞辱!):

220 parrot.email-provider.co.uk ESMTP Postfix 
hello: 250-parrot.email-provider.co.uk
250-PIPELINING
250-SIZE 512000000
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
Failed to authenticate password. Error: 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6 
from: 250 2.1.0 Ok
to: 554 5.7.1 : Relay access denied
The following SMTP error was encountered: 554 5.7.1 : Relay access denied 
to: 554 5.7.1 : Relay access denied
The following SMTP error was encountered: 554 5.7.1 : Relay access denied 
to: 554 5.7.1 : Relay access denied
The following SMTP error was encountered: 554 5.7.1 : Relay access denied 
data: 554 5.5.1 Error: no valid recipients
The following SMTP error was encountered: 554 5.5.1 Error: no valid recipients 
221 2.7.0 Error: I can break rules, too. Goodbye. 
The following SMTP error was encountered: 221 2.7.0 Error: I can break rules, too. Goodbye. 
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Wed, 7 Dec 2011 13:30:16 +0000
From: "Mysite.com" 
Return-Path: 
To: myemail@email.com
Cc: myotheremail@email.com
Subject: =?utf-8?Q?The_Subject?=
Reply-To: "mail@mysite.com" 
X-Sender: mail@mysite.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <4edf6a68626d6@mysite.com>
Mime-Version: 1.0

【问题讨论】:

  • 您的实际 PHP 代码是什么样的?尤其是设置身份验证的部分。

标签: php email codeigniter smtp


【解决方案1】:

可以是:

  1. 密码错误。

  2. 服务器不允许/识别的登录方法。

【讨论】:

    【解决方案2】:

    如果您使用的是 codeigniter 邮件对象,请尝试: $this->email->print_debugger()

    蛮力法,从应用程序上一层,放入log_message/trace等,调试实际的codeigniter代码,看看是怎么回事。

    【讨论】:

      【解决方案3】:

      我遇到了同样的问题。我已将一切设置好并收到相同的消息。

      问题在于,在使用$this-&gt;email-&gt;initialize($config) 应用smtp 设置之前,我已经使用$this-&gt;email-&gt;to 设置了to 地址。在我将这条线移到所有其他设置之前,一切都按预期进行。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-10-18
        • 2014-11-15
        • 2015-09-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-06
        • 1970-01-01
        相关资源
        最近更新 更多