微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

是否可以在PHP的Mail函数中添加CSS?

如何解决是否可以在PHP的Mail函数中添加CSS?

我想在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吗?

解决方法

因为您没有在componentDidMount() { const tableSections = [ 'audit_general','audit_culture','audit_performance','audit_policies','audit_risk','audit_strategy','audit_rewards','audit_workforce' ]; for (let i = 0; i < tableSections.length; i++){ this.grabTableData(tableSections[i]); } } async grabTableData (tableName) { await fetch(API_URL + `/responses/${tableName}/${this.props.employeeId}`) .then((res) => { if (!res.ok) { throw new Error(); } return res.json(); }) .then((result) => { this.setState({ ...result[0],}); }) .catch((error) => { console.log(error); }); } 内转义"

尝试:

"

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。