codeigniter の email クラスで奇妙な問題が発生しています。Gmail アカウントのメール アドレスに直接メールを送信すると、問題なく動作します。ただし、別のメール アドレスにメールを送信し、POP3 を使用してそのメール アドレスを gmail にインポートすると、何らかの理由ですべてのヘッダーがメッセージに含まれます。
メールを送信するためのコードは次のとおりです。
$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 にインポートされたアカウントに送信されたときに受信トレイに届くのは次のとおりです。
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--