PHPでhtml/html5メールを送信したいと思います。私は、私がユーザーに送る予定の電子メールメッセージを持つhtmlテンプレートを持っています。あなたが含ま前に変数を設定する必要がmailservice.phpPHPでhtml/html5テンプレートメールを送信するには?
/* getting the content from te default-message.html file*/
ob_start();
include('default-message.php');
$message = ob_get_contents();
ob_end_clean();
$name = "John";
$to = "[email protected]";
$subject = "Hello";
$headers .= 'From: Me <[email protected]>' . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail ($to, $subject, $message, $headers);
あなたはどんな特有の問題を抱えていますか? – Blake
円形の 'include'を作成したようです。 –
@Blake拡張ファイルを.htmlに変更すると電子メールが送信されますが、変数$ nameはコンパイルされません。PHPを使用していません... – que1326