如何首先包含描述,然后在发送电子邮件时显示html文件?
下面的<?php
//declaring variables to null
$f_name = $l_name = $email = '';
$f_nameERR = $l_nameERR = $emailERR ='';
// On submitting form below function will execute.
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["fname"])) {
$f_nameERR = "<div class='alert alert-danger alert-dismissible' role='alert'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button>First name is required </div>";
} else {
$f_name = $_POST["fname"];
}
if (empty($_POST["lname"])) {
$l_nameERR = "<div class='alert alert-danger alert-dismissible' role='alert'> <button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button>Last Name is required </div>";
} else {
$l_name = $_POST["lname"];
}
if (empty($_POST["email"])) {
$emailERR = "<div class='alert alert-danger alert-dismissible' role='alert'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button>Email Address is required </div>";
} else {
$email = $_POST["email"];
}
}
?>