我试图发送HTML邮件与WordPress的功能wp_mail()这样的:CSS将无法正常工作
add_filter('wp_mail_content_type', function($content_type) { return 'text/html'; });
$headers = 'From: '. $current_user->user_firstname . ' ' . $current_user->user_lastname .' <'. $current_user->user_email .'>' . "\r\n";
wp_mail($_POST['email'], $_POST['subject'], $_POST['mail_text'], $headers);
remove_filter('wp_mail_content_type', 'set_html_content_type');
所有的HTML标签,如<strong>
,<li>
,<p>
等与HTML格式。但是当我尝试使用HTML或CSS(如<li style="color:red">Word</li>
或<li color="red">Word</li>
)更改颜色时,它不起作用,并显示为空白文本。
我在做什么错?