|
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.163.com';
$config['smtp_user'] = 'ecenlishadmin@163.com';
$config['smtp_pass'] = '******';
$config['smtp_port'] = '25';
$config['smtp_timeout'] = '5';
$config['newline'] = "/r/n";
$config['charset']='utf-8';
$this->email->initialize($config);
$this->email->from('ecenlishadmin@163.com', 'Lange');
$this->email->to('261109149@qq.com');
$subject='test codeigniter email class!';
$msg='test email send';
$this->email->subject($subject);
$this->email->message($msg);
$this->email->send();
echo $this->email->print_debugger();
这是我控制器的方法,但是最后运行后报错了。
220 163.com Anti-spam GT for Coremail System (163com[20141201])
hello: 250-mail250-PIPELINING250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250-coremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UrOOLuXUCa0xDrUUUUj250-STARTTLS250 8BITMIME
验证密码失败。错误:535错误:身份验证失败
无法使用PHP发送电子邮件的SMTP。您的服务器可能不被配置为发送邮件使用这种方法。
Failed to authenticate password. Error: 535 Error: authentication failed
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniterDate: Wed, 17 Aug 2016 10:39:27 +0200From: "Lange" <ecenlishadmin@163.com>Return-Path: <ecenlishadmin@163.com>To: 261109149@qq.comSubject: =?utf-8?Q?=74=65=73=74=20=63=6F=64=65=69=67=6E=69=74=65=72=20=65=6D=61=69?= =?utf-8?Q?=6C=20=63=6C=61=73=73=21?=Reply-To: "ecenlishadmin@163.com" <ecenlishadmin@163.com>X-Sender: ecenlishadmin@163.comX-Mailer: CodeIgniterX-Priority: 3 (Normal)Message-ID: <57b422bf41634@163.com>Mime-Version: 1.0Content-Type: text/plain; charset=utf-8Content-Transfer-Encoding: 8bittest email send希望那位老师帮忙看一下。163邮箱的设置我也设置了!
先谢谢了!
|
|