可以在中添加标记。只需像普通的html页面一样工作。
在以前的项目中尝试过,效果很好。
<?php
$to = htmlspecialchars("info@example.com");
$subject = htmlspecialchars("Subject");
$message = "
<html>
<head>
<style>
td{outline:0; text-decoration: none;}
p{font-weight:bold;color:red;}
a{text-decoration: none; border: 0; color: red; font-weight:bold;}
</style>
<title>HTML email</title>
</head>
<body>
<table>
<tr>
<td><a href="mailto:info@example.com">info@example.com</a></td>
</tr>
</table>
<p>My paragraph has style !</p>
</body>
</html>
";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <info@example2.com>' . "\r\n";
mail($to, $subject, $message, $headers);
?>