在codeigniter中遇到了一個電子郵件類的奇怪問題。當我直接發送電子郵件到我的Gmail帳戶電子郵件地址,它工作正常。但是,如果我將電子郵件發送到其他電子郵件地址並使用POP3將該電子郵件地址導入到Gmail中,那麼出於某種原因,所有標題都將包含在郵件中。向Codeigniter發送電子郵件時出現問題 - 在郵件正文中發送郵件頭
下面的代碼發送電子郵件:
$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帳戶:
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--
嘗試將mailtype從html更改爲文本。 – 2011-01-09 05:54:15