【发布时间】:2020-10-01 06:29:05
【问题描述】:
我想在Mail函数中添加一些css到这段代码中:
$text .= "<h1>Confirmation Code</h1>";
$text .= "<img src='https://pbs.twimg.com/profile_images/587949417577066499/3uCD4xxY_400x400.jpg'></img>";
$text .= "<h3>This is your confirmation code. Enter it into the text box in World Web. Here is the code: '".$_REQUEST['random_num']."'</h3>";
$text .= "<h4>Thank you for working with WWW. We appreciate the help!</h4>";
$text .= "</body></html>";
$subject = "Confirmation Code";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$to = $_REQUEST['email'];
mail($to, $subject, $text, $headers);
但是当我添加:
style="color: red;"
或者:
style="background-color: blue;"
它出错了。有人知道我如何在 php 中将 css 添加到邮件功能吗?
【问题讨论】:
标签: javascript php css function email