且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Codeigniter 3:发送帐户激活电子邮件失败

更新时间:2023-12-04 09:47:40

检查您是否具有必需的SMTP服务. 尝试使用Google SMTP服务.

Check if you have the required SMTP service. Try with google SMTP service.

    $config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => 'xxx',
    'smtp_pass' => 'xxx',
    'mailtype'  => 'html', 
    'charset'   => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");

$this->email->from('mygmail@gmail.com', 'myname');
$this->email->to('target@gmail.com'); 

$this->email->subject('Email Test');
$this->email->message('Testing the email class.');  


$result = $this->email->send();

接下来尝试:

  $config = array('mailtype' => 'html'); 

从$ config = array中删除其余部分.

Remove the rest from $config = array.