【发布时间】:2017-11-29 09:29:22
【问题描述】:
我使用 CodeIgniter 发送邮件,但它返回此错误:
验证密码失败。错误:535-5.7.8 用户名和 密码不被接受
这是我的代码:
$this->load->library('email');
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 587,
'smtp_user' => 'my@gmail.com',
'smtp_pass' => 'mypass',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->from('my@gmail.com');
$this->email->to('send@gmail.com');
$this->email->subject('This the test');
$this->email->message('this is the test message');
if (!$this->email->send())
{
echo $this->email->print_debugger();
}
我已经使用这个问题配置了我的 Xampp 服务器:How to configure XAMPP to send mail from localhost?
【问题讨论】:
-
这是来自邮件服务器的响应。听起来您为该服务器使用了错误的用户名和密码。
标签: php codeigniter email xampp