[英]Codeigniter SMTP Email Error
使用帶有我的codeigniter應用程序的SMTP時,我無法收到要發送的電子郵件。
在SO上有很多類似的問題,但沒有一個可以解決我的問題,所以這就是為什么我要再問一次。
這是我得到的錯誤:
hello:
The following SMTP error was encountered:
Failed to send AUTH LOGIN command. Error:
from:
The following SMTP error was encountered:
to:
The following SMTP error was encountered:
data:
The following SMTP error was encountered:
The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Tue, 22 Apr 2014 22:54:12 -0400
From:
Return-Path:
To: myemail@gmail.com
Subject: =?utf-8?Q?Request_from_C&J_Builders_Contact_form?=
Reply-To: "donotreply@C&JBuilders.us"
X-Sender: donotreply@C&JBuilders.us
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <53572b54551be@C&JBuilders.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
From: jeff
Email: jeff@gmail.com
Phone: 555555555
Message: asdfs fds
Here's my config/email.php:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
$config['useragent'] = "CodeIgniter";
$config['protocol'] = "smtp";
$config['_smtp_auth'] = TRUE;
$config['smtp_host'] = "smtp.zoho.com";
$config['smtp_user'] = "donotreply@cjbuilders.info";
$config['smtp_pass'] = "mypassword";
$config['smtp_port'] = 465;
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;
$config['mailtype'] = "text";
$config['charset'] = "utf-8";
$config['validate'] = FALSE;
$config['priority'] = 3;
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$config['bcc_batch_mode'] = TRUE;
$config['bcc_batch_size'] = "200";
?>
這是我發送電子郵件的控制器代碼段:
// sends the email to
$this->email->from('donotreply@C&JBuilders.us');
$this->email->to('myemail@gmail.com');
$this->email->subject('Request from C&J Builders Contact form');
$this->email->message('From: '.$this->input->post('name')."\n".
'Email: '.$this->input->post('email')."\n".
'Phone: '.$this->input->post('phone')."\n".
'Message: '.$this->input->post('message')."\n");
$this->email->send();
echo $this->email->print_debugger();
對於SSL,將ssl://
添加到SMTP主機地址
$config['smtp_host'] = "ssl://smtp.zoho.com";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.