我有下面的PHP代碼:從電子郵件中刪除HTML標記,德興電子郵件正文
<?php
header('Content-Type: text/html; charset=utf-8');
if (isset($_POST['email']))
//if "email" is filled out, send email
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$formcontent="<html><body>
<span style='background-color: #cdcdcd'>
text: $name
</span>
text: $phone
<span style='background-color: #cdcdcd'>
text: $email
</span>
text: $message </html><body/>";
$recipient = "[email protected]";
$subject = "text text text ";
$headers = "From: $email" . "\r\n" .
"Reply-To: $email" . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($recipient, $subject, $formcontent, $headers) or die("Error!");
echo "Thank You!";
?>
的問題是,wehn我收到的電子郵件,我看到在郵件正文中的所有HTML標籤,並且電子郵件不是造型。
我的問題是我該如何解決它?
我會注意到它,非常感謝! –