テキストまたは/およびhtmlバージョンを送信して電子メールで送信しようとしています。
私がしていることはこれです:
$bodyHTML = "
--PHP-alt-$random_hash
Content-Type: text/plain; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
http://example.com/app_dl.php?app_id=$_GET[app_id] to download your $app_name app \n\r
Want to get tons more hot apps for free! anywhere anytime? Download our app on http://example' \n\r\n\r
example.com team
--PHP-alt-$random_hash
Content-Type: text/html; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
<p><a href='http://example.com/app_dl.php?app_id=$_GET[app_id]'>Click Here</a> to download your $app_name app</p>
<p>Want to get tons more hot apps for free! anywhere anytime? Download our app on <a href='http://example.com'>example.com</a></p>
<br/>
<p>example.com team</p>
--PHP-alt-$random_hash ";
endif;
これは私が得るものです:
--PHP-alt-f4b83c7072ae970392b44308a6c36109 Content-Type: text/plain; charset='iso-8859-
1' Content-Transfer-Encoding: 7bit http://example.com/app_dl.php?app_id=35 to download your PhoneMates app Want to get tons more hot apps for free! anywhere anytime? Download our app on http://example.com' example.com team --PHP-alt-f4b83c7072ae970392b44308a6c36109 Content-Type: text/html; charset='iso-8859-1' Content-Transfer-Encoding: 7bit
Click Here to download your PhoneMates app
Want to get tons more hot apps for free! anywhere anytime? Download our app on example.com
example.com team
--PHP-alt-f4b83c7072ae970392b44308a6c36109
問題は、これらのヘッダー行がすべて表示され、コンテンツタイプが表示され、テキスト行が「\ n\r」でフォーマットされないことです。
また、一方のバージョンが失敗した場合に、もう一方のバージョンが表示されるという効果を達成できるかどうかもわかりません。助けてくれてありがとう
コードの一部を次に示します。
$random_hash = md5(date('r', time()));
$boundary="PHP-alt-".$random_hash;
$headers = array ('From' => $from,
'Content-Type'=> 'multipart/alternative',
'boundary'=>$boundary,
'To' => $to,
'Return-Path' => 'info@example.com',
'Subject' => $subject);
送信者、パス、タイトル、関連するアレントなどの他の詳細..したがって、ここではそれらを提示しませんでした。