我试图添加这个html电子邮件的背景色。
我试着把
<script>标记我在一个单独的.html文件上测试的所有方法都改变了我想要的。我只是无法在实际的电子邮件中找到它。我在php中使用mail()。
$message = "
<html>
<head>
<title>Rate Your Experience</title>
</head>
<body bgcolor = '#0000FF'>
<center>
<p>
<h2>How well did '$recipient' do?</h2>
<h4>Vacancy Title: '$vac_title'</h4>
<h4>Vacancy ID: '$vac_id'</h4>
</P>
</center>
<center>
<table>
<tr>
<td><h3>we are built on sharing your review with other people who may also want to use this service.</h3></td>
</tr>
<tr>
<td><h3>Please take a minute to reflect on the level of service youve received.</h3></td>
</tr>
<tr>
<td><h3>Your review is public - to other employers registered with Ahoy Employ.</h3></td>
</tr>
<tr>
<td><h3>Should you have any concerns that you would prefer to share in private, please email us at info@website.ca and quote the Vacancy ID shown above.</h3></td>
</tr>
</table>
</center>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <webmaster@provider.ca>' . "\r\n";
mail($to,$subject,$message,$headers);发布于 2017-06-20 03:01:36
这样做:
<body style="background-color:#cfcfcf";>发布于 2017-06-20 04:06:57
发布于 2017-06-20 04:11:13
如果您正在使用电子邮件模板,那么您可以写内联css以及嵌入css标签。
另外,您可以在html代码中编写内联css。
https://stackoverflow.com/questions/44643047
复制相似问题