私はhtmlメールを作成しましたwelcome.tpl
そのファイルをメッセージの本文として送信するためにはどのようなPHPメールメソッドを使用する必要がありますか? HTMLメールテンプレートファイルとPHPの処理
$text_content.= "\r\n";
$text_content.= "--------------------------------\r\n";
$html_content.= "</body></html>";
$mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x';
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\r\n";
$headers.= "Content-Transfer-Encoding: 7bit\r\n";
$body = "--$mime_boundary\n";
$body.= "Content-Type: text/plain; charset=\"charset=us-ascii\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= $text_content;
$body.= "\n\n";
$body.= "--$mime_boundary\n";
$body.= "Content-Type: text/html; charset=\"UTF-8\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= $html_content;
$body.= "\n\n";
$body.= "--$mime_boundary--\n";
$headers.= 'From: So <[email protected]>' . "\r\n";
$headers.= "X-Sender-IP: $_SERVER[SERVER_ADDR]\r\n";
$headers.= 'Date: '.date('n/d/Y g:i A')."\r\n";
$headers.= 'Reply-To: So <[email protected]>' . "\r\n";
mail($en['email'], $subject, $body, $headers);
私は$body = file_get_contents();
のようなものを使用し、mail();
最善の方法であるべきか?
使用しているテンプレートライブラリhttp://developer.postmarkapp.com/developer-libs.html#php-5のいくつかを見てみましょう:消印付き
、あなたはこのような何かを行うことができますか? welcome.tplとメール機能の重要な部分を表示できますか? – Jomoos
@Jomoos私の現在のmail()関数のスニペットを追加しました。welcome.tplについては、必要な電子メールのみを使用している基本的なhtmlのみ受け入れ可能なhtml/css – acctman