当我尝试使用codeigniter“email”库发送邮件时,它会发出身份验证错误。我已经修改了“sendmail.ini”文件中的“auth_username”和“auth_password”。 我无法从哪里开始解决问题。请帮助....
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
// 'smtp_host' => 'localhost',
// 'mailpath' => "/usr/bin/sendmail",
'smtp_port' => '465',
'smtp_user' => $sender,
'smtp_pass' => $senderPass,
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email');
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from($sender);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($body);
if(!$this->email->send())
{
show_error($this->email->print_debugger());
}