由於某些原因,當我發送電子郵件時,HTML仍以純文本形式顯示。有人可以告訴我我在做什麼錯嗎?無法使用HTML格式化PHP電子郵件
下面是代碼:
$to = $_SESSION['customer_email'];
$from = "[email protected]";
$subject = "Confirmation for Appointment on ".$_SESSION['display_date'];
$headers = "From: ".$from."\r\n";
$headers .= "Content-type: text/html; charseet=UTF-8;\r\n";
$headers .= "MIME-Version: 1.0;\r\n";
$message = "<p>Thank you".$_SESSION['firstname']." for booking online. Your appointment has been confirmed and is scheduled for <strong>".$_SESSION['display_date']."</strong> between the hours of <strong>".$_SESSION['display_time']."</strong>.</p><p> Please expect our crew to arrive between your two hour arrival window. You will receive a courtesy call when our crew is <span>15-30 minutes</span> away. A confirmation email has been sent to <strong>".$_SESSION['customer_email']."</strong>. </p><p> If you have any questions or need to make any changes to your appointment, please contact our office at <strong>1-800-333-1111</strong>. Thank you for choosing Us!
</p>";
if(mail($to, $subject, $message, $header))
{
$msg = "Your message has been sent";
}
謝謝。我覺得自己像個白癡。 – BlackHatSamurai