gpt4 book ai didi

php - 如何在php邮件中添加css样式?

转载 作者:太空宇宙 更新时间:2023-11-03 21:41:07 24 4
gpt4 key购买 nike

如何在电子邮件 php 中添加标签?例如,我想加粗我的 $for_pass。有什么想法吗?谢谢

$subject = "Password Recovery";
$message = "Hi! Your member password is <strong>$for_pass</strong>";
$from = "smilepartyplanner2014@gmail.com";
$headers = "From:" . $from;
// send mail
$mail_sent = @mail( $forgot_email, $subject, $message,$headers );
//echo "Thank you for sending us feedback";

?>
<script>

alert("Your password has been sent to your email address. ");

</script>
<?php

最佳答案

您需要在您的邮件中发送 MIME header 来告诉它的 HTML,如下所示:

$headers = "From:" . $from . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$mail_sent = @mail($forgot_email, $subject, $message, $headers);

关于php - 如何在php邮件中添加css样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23540313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com