我已经在Codeigniter应用程序中配置了以下电子邮件功能…
$config = [
'protocol' => 'smtp',
'smtp_host' => 'smtp.xxxxx.com',
'smtp_user' => 'xxxxx',
'smtp_pass' => 'xxxxx',
'newline' => "rn",
'smtp_port' => 587,
'mailtype' => 'html',
'charset' => 'UTF-8'
];
和发送使用…
$sub = 'KONERU Created Sucessfully';
$msg = '<p><a href="koneru.com" >KONERU</a> - Has been Created Sucessfully!</p>';
$msg .= '<br><br><br><p>This mail Generated by computer.<br>Please Don't replay to this mail.</p>';
$this->load->library('email', $config);
$this->email->from('xxxxxxxxx','xxxxxxx xxxxxx');
$this->email->to('xxxxxxxxxxxxxx');
$this->email->subject($sub);
$this->email->message($msg);
$this->email->send();
我可以发送电子邮件,但是我没有在Outlook收件箱中看到正确的HTML格式,我看到这样的东西…
KONERU - Has been Created Su=essfully!
This mail Generated by c=mputer.
Please Don't replay to this mail.
我不知道为什么,我在文本之间看到一些'=',我尝试了不同的字符集,如UTF-8, iso-8859-1,但似乎没有任何工作。
如果我使用mailtype =' text',那么如果我试图发送一个没有HTML标签的纯文本,我不会在文本之间看到任何'='。
终于来了!通过添加…
$this->email->set_crlf( "rn" );
配置,解决我的问题。