【发布时间】:2015-07-20 00:19:57
【问题描述】:
我正在尝试使用 Wordpress 函数 wp_mail() 发送 HTML 邮件,如下所示:
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' );
<strong>、<li>、<p> 等所有 HTML 标签都带有 HTML 格式。但是,当我尝试使用 HTML 或 CSS(如 <li style="color:red">Word</li> 或 <li color="red">Word</li>)更改颜色时,它不起作用并显示为空白文本。
我做错了什么?
【问题讨论】:
标签: php html css wordpress email