如何在CodeIgniter中以base64编码发送电子邮件?

时间:2011-10-18 08:08:18

标签: php codeigniter sendmail

我正面临着电子邮件中奇怪的惊叹号的问题。为此,我使用base64编码在单独的邮件功能中进行了测试。多数民众赞成工作。我像这样设置标题。

$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中设置相同的标头选项。我尝试了配置中的选项。

$_configure['_encoding']="base64";
$email= new Email($config);    

但它不起作用。如何在CodeIgniter中设置如上所示的标题?

修改

目前仅使用CodeIgniter电子邮件类。

1 个答案:

答案 0 :(得分:3)

$config['_bit_depths'] = array('7bit', '8bit', 'base64');
$config['_encoding'] = 'base64';