私は非常に単純な PHP 関数を使用して、HTML / プレーンテキストの電子メールを作成しています。gmailや私が見た他の多くのクライアントでうまくいきました。
結局のところ、@live.com アカウントはメールの内容をまったく見ることができません。
関連するコードは次のとおりです。
$random_hash = md5(date('r', time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: server@example.com\r\nReply-To: server@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
//add boundary string and mime type specification
$headers .= "Content-Type: multipart/alternative; boundary=$random_hash\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
//define the body of the message.
$message = "This is a MIME encoded message.\r\n\r\n" .
"--$random_hash\r\n" .
"Content-Type: text/plain; charset=utf-8\r\n" .
//"Content-Transfer-Encoding: 7bit\r\n" .
"\r\nthis is plain text.\r\n\r\n" .
"--$random_hash\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
//"Content-Transfer-Encoding: 7bit\r\n" .
"\r\n<html><body>this is wonderful <b>HTML</b> text.</body></html>" .
"\r\n\r\n--$random_hash--\r\n";
mail('someAddress@live.com', 'This is u umlaut: ü', $message, $headers);
HTMLまたはプレーンテキストのみを送信すると、正しく表示されます。
何か案は?
余分なライブラリを使用したくありません。HTML が必要なのは、基本的にはリンクだけです。PHP Multi-Part Text/HTML の空白表示に関する回答は役に立ちません。
ところで、u ウムラウトは、live.com 受信ボックスの電子メール リストに正しく表示されませんが、live.com で電子メールを開くと正しく表示されます...