2
我試圖使用CodeIgniter版本2.1.4爲辦公室365使用SMTP服務器發送電子郵件。我知道登錄是正確的。以下是我的配置+調試器輸出。CodeIgniter 2.1.4版本無法通過smtp發送郵件給辦公室365
的application/config/email.php
<?php
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'tls://smtp.office365.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'PASSWORD';
$config['smtp_port'] = '587';
$config['charset']='utf-8';
$config['newline']="\r\n";
$config['crlf'] = "\r\n";
?>
電子郵件調試錯誤:
The following SMTP error was encountered: 0
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:
from:
The following SMTP error was encountered:
Unable to send data: RCPT TO:
to:
The following SMTP error was encountered:
Unable to send data: DATA
data:
The following SMTP error was encountered:
Unable to send data: User-Agent: CodeIgniter Date: Mon, 6 Apr 2015 12:19:52 -0400 From: "PHP Point Of Sale, LLC" Return-Path: To: [email protected] Subject: =?utf-8?Q?Sales_Receipt?= Reply-To: "[email protected]" X-Sender: [email protected] X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_5522b228bf4b9" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_5522b228bf4b9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit PHP Point Of Sale, LLC 123 Nowhere street 555-555-5555 Sales Receipt 04/06/2015 12:19 pm Customer: Chris Muench - Apple - 3333 Address : 6 Heron Way N Fairport NY, 14450-3318United States Phone Number : testE-Mail : [email protected] ID: POS 9 Register Name: Default Employee: John Doe Item Price Qty. Total TEST (Size) $12.00 1 $12.00 Sub Total $12.00 Total $12.00 Payment Type Cash $12.00 Change Due $0.00 Change return policy --B_ALT_5522b228bf4b9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
你應該升級到3.0笨最新版本 – user4419336
我不知道CI電子郵件庫支持(TLS | SSL)連接要求。您可能需要一個可以處理這些傳輸類型的庫。 http://getsparks.org/packages/swift-mailer/versions/HEAD/show – Philip
@ mustang83不幸的是,CI 3剛剛問世,需要進行相當數量的代碼更改才能正常工作。我正在尋找CI 2修復程序。 –