【发布时间】:2020-04-22 09:57:37
【问题描述】:
我正在尝试使用 CodeIgniter 发送电子邮件。当我尝试发送电子邮件时,我收到此错误:
Failed to authenticate password. Error: 535 Authentication Failed for no-reply@sample.com
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
我正在使用这段代码:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtpout.secureserver.net',
'smtp_port' => '465',
'smtp_user'. => 'no-reply@sample.com',
'smtp_pass' => '0p9o8i7u',
'smtp_crypto' => 'ssl',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'crlf' => "\r\n"
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('no-reply@sample.com', 'SYSTEM ROBOT');
$this->email->to('recipient@outlook.com');
$this->email->subject('Sample Subject');
$this->email->message('HTML Content here');
if($this->email->send()){
return true;
} else {
return show_error($this->email->print_debugger());
}
我的项目目前由 GoDaddy 托管,以及我用来发送电子邮件的电子邮件(本例中为 no-reply@sample.com)。
我基于 GoDaddy 网站的 SMTP 设置:https://ph.godaddy.com/help/mail-server-addresses-and-ports-for-business-email-24071
我使用的密码也是正确的,因为我尝试使用 RoundCube 登录电子邮件帐户。
如何解决我遇到的错误?
【问题讨论】:
标签: php codeigniter email