如何在CodeIgniter中以base64编码发送电子邮件? [英] How to send an email in base64 encode in CodeIgniter?
本文介绍了如何在CodeIgniter中以base64编码发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在面对电子邮件中出现奇怪的感叹号的问题.为此,我使用base64编码在单独的邮件功能中进行了测试.那很好.我这样设置标题.
I am facing the issue the odd exclamation symbol in email. For that I tested in seperate mail funation with base64 encode. Thats working fine. I set the header like this.
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "Content-Transfer-Encoding:base64" . "\r\n";
// More headers
$headers .= 'From:'.$from. "\r\n";
$htmlcode = rtrim(chunk_split(base64_encode($msg)));
$ret=mail($to,$subj,$htmlcode,$headers);
现在,我想在CodeIgniter中设置相同的标头选项.我尝试了配置中的选项.
Now I want to set the same header option in CodeIgniter. I tried with the option in configuration.
$_configure['_encoding']="base64";
$email= new Email($config);
但是它不起作用.如何在CodeIgniter中像上面那样设置标题?
But it doesn't work. How can set the header like above in CodeIgniter?
当前仅使用CodeIgniter Email类.
Currently using CodeIgniter Email class only.
推荐答案
$config['_bit_depths'] = array('7bit', '8bit', 'base64');
$config['_encoding'] = 'base64';
这篇关于如何在CodeIgniter中以base64编码发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文