2011-12-07 47 views
5

我試圖通過SMTP從我的PHP腳本發送郵件,通過CodeIgniter運行。從PHP發送郵件 - 是我的錯誤,還是郵件服務器?

請參閱下面的調試輸出。這是表明一個問題,我用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: [email protected] 
Cc: [email protected] 
Subject: =?utf-8?Q?The_Subject?= 
Reply-To: "[email protected]" 
X-Sender: [email protected] 
X-Mailer: CodeIgniter 
X-Priority: 3 (Normal) 
Message-ID: <[email protected]> 
Mime-Version: 1.0 
+0

你的實際PHP代碼是什麼樣的?尤其是您設置身份驗證的部分。 – Oldskool

回答

0

如果您使用的是笨郵件對象,嘗試: $這個 - >的電子郵件 - > print_debugger()

蠻力方法,從應用程序進入上一層,放在log_message /跟蹤,調試實際的codeigniter代碼,看看發生了什麼。

1

可以是:

  1. 錯誤的密碼。

  2. 登錄方法不允許/服務器識別。

0

我有同樣的問題。我已經設置好一切,並獲得相同的信息。

問題是因爲我已經設置to地址$this->email->to之前我已應用與$this->email->initialize($config) smtp設置。在所有其他設置之前移動此行之後,所有事情都按照預期運行。

相關問題