これにより HTML が影響を受けているため、電子メールの 990 文字の制限に役立つ関数/クラス/などがあるかどうかを知りたいです。
問題: (ソース)
メールサーバーには、電子メールメッセージに含まれる各行に 990 文字の制限があることに注意してください。990 文字を超える行を含む電子メール メッセージが送信されると、それらの行は追加の行末文字によって分割され、特に HTML コンテンツの電子メール メッセージが破損する可能性があります。これが発生しないようにするには、電子メール メッセージ内の適切な場所に独自の行末文字を追加して、1 行が 990 文字を超えないようにしてください。
他の誰かがこの問題を抱えているようですか?どうやってこれを修正しましたか?
HTML を分割して手動で改行を追加するのに適切な場所を見つける必要があるようですね。
アップデート:
行数の多いタブ譜データです。<br />
\n またはどこかに追加する必要がありますか?
更新 #2: MIME タイプ コードの追加
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: quoted-printable\r\n"; // added this, but still no results
$headers .= "From: from@email.com\r\n";
関数を呼び出す方法は次のとおりです。
私が最初に呼んだ方法:
return $html;
私が試したこと:
return imap_8bit($html); // not working, nothing is captured in the error log
と
return imap_binary($html); // not working, nothing is captured in the error log
UPDATE #3 (メール機能の追加)
try {
mail(
'to@email.com',
'Subject of Email',
$html,
$headers
);
} catch (Exception $e) {
echo ("ERROR: Email NOT sent, Exception: ".$e->getMessage());
}
HTML の例 (これは HTML メールのメッセージです) (これも XMLRPC サービスの一部であるクラスにあります)
private function getHTML() {
$html = '<html><head><title>Title</title></head><body>';
$html .= '<table>';
$html .= '<tr><td>many many rows like this</td></tr>';
$html .= '<tr><td>many many rows like this</td></tr>';
$html .= '<tr><td>many many rows like this</td></tr>';
$html .= '<tr><td>many many rows like this</td></tr>';
$html .= '<tr><td>many many rows like this</td></tr>';
$html .= '</table>';
$html .= '</body>';
$html .= '</html>';
return $html;
//return imap_8bit($html); // not working, nothing is captured in the error log
//return imap_binary($html); // not working, nothing is captured in the error log
// Both of these return the XMLRPC Fault Exception: 651 Failed to parse response
}
Fault Exception: 651 Failed to parse response 基本的に、形式やデータが返される方法が好きではありません。