很抱歉,重新提出一个旧问题,但通过标题设置这样是否更好:
$subject = "MyPlugin: Alert (".get_bloginfo(\'wpurl\').")";
$headers = "MIME-Version: 1.0" . "\\r\\n";
$headers .= "Content-type: text/html; charset=".get_bloginfo(\'charset\')."" . "\\r\\n";
$headers .= "From: MyPlugin <".$this->settings[\'from_address\'].">" . "\\r\\n";
wp_mail($this->settings[\'notify_address\'], $subject, $alertMessage, $headers);
这样,您就不必担心使用过滤器然后在之后删除
wp_mail()
.