问题描述
在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 protected]', 'Website');
$this->email->to('[email protected]');
$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 protected]>
Reply-To: "[email protected]" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
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发送电子邮件时出现问题 - 邮件正文中发送的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!