使用Codeigniter发送电子邮件时出现问题 - 邮件正文中发送的标题 [英] Problem sending email with Codeigniter - Headers sent in the message body

查看:385
本文介绍了使用Codeigniter发送电子邮件时出现问题 - 邮件正文中发送的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在codeigniter的电子邮件类有一个奇怪的问题。当我直接发送电子邮件到我的gmail帐户电子邮件地址,它工作正常。但是,如果我向其他电子邮件地址发送电子邮件,并使用POP3将该电子邮件地址导入gmail,则由于某种原因,邮件中会包含所有标头。

Having a strange issue with the email class in codeigniter. When I send email directly to my gmail account email address, it works fine. However if I send email to a different email address and use POP3 to import that email address into gmail, then for some reason all the headers are included in the message.

发送电子邮件的代码:

$this->email->clear();
$config['mailtype'] = "html";
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from('email@example.com', 'Website');
$this->email->to('accountthatimportstogmail@url.com');
$this->email->message($message);

当电子邮件发送到通过POP3导入Gmail的帐户时,我的收件箱中会显示什么:

Here's what arrives in my inbox when the email is sent to an account which is imported into gmail via POP3:

Date: Fri, 7 Jan 2011 15:07:04 +0000

From: "Website" <email@example.com>
Reply-To: "email@example.com" <email@example.com>
X-Sender: email@example.com

X-Mailer: CodeIgniter

X-Priority: 3 (Normal)

Message-ID: <4d272c1835479@example.com>

Mime-Version: 1.0

Content-Type: multipart/alternative; boundary="B_ALT_4d272c1835c46"




This is a multi-part message in MIME format.

Your email application may not support this format.



--B_ALT_4d272c1835c46

Content-Type: text/plain; charset=utf-8

Content-Transfer-Encoding: 8bit



this is the email message content





--B_ALT_4d272c1835c46

Content-Type: text/html; charset=utf-8

Content-Transfer-Encoding: quoted-printable

<html>
<body>
       <p>this is the email message content
</p>
</body>
</html>



--B_ALT_4d272c1835c46--


推荐答案

请使用
$ config ['protocol'] ='sendmail';

Please use $config['protocol'] = 'sendmail';

这篇关于使用Codeigniter发送电子邮件时出现问题 - 邮件正文中发送的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆