在codeigniter中使用SMTP的郵件內容錯誤 實際上,我的郵件與HTML
標籤一起發送,它顯示HTML
標籤不正確。使用codeigniter發送html郵件
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => '',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$email_body ="<div>hello world</div>";
$this->email->from('[email protected]', 'ddd');
$list = array('[email protected]');
$this->email->to($list);
$this->email->subject('Testing Email');
$this->email->message($email_body);
$this->email->send();
echo $this->email->print_debugger();
如果我不使用SMTP發送郵件,它工作正常。我的錯誤是什麼?
我不認爲'ssl://'是主機名的一部分。也許還有另一種設置打開SSL? – 2012-02-03 21:00:05
codeigniter完整的html電子郵件配置:http://stackoverflow.com/a/38740292/4376484 – Pran 2016-08-03 14:26:30