如何在WordPress中添加电子邮件内容的超链接? 时间:2014-01-13 作者:Naveen $message = sprintf(__(\'Dear: %s\'), $user_login) . "\\r\\n\\r\\n"; $message .= __(\'As per your request on \') . date_i18n(\'j F Y\', time());"\\r\\n\\r\\n"; $message .= __(\'Please visit the following link to reset your email address:\') . "\\r\\n\\r\\n"; $message .= \'<\' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), \'login\') . ">\\r\\n"; $message .= __(\'In case of any queries, you can write to us at\') . "\\r\\n\\r\\n"; $email_id_reset = \'<a href="[email protected]">Email</a>\'; $message .= __(\'Thanks and Best Regards,\') . "\\r\\n\\r\\n"; 我想显示下面提到的信息。如有任何疑问,请致电e-mail.谢谢和问候 2 个回复 最合适的回答,由SO网友:Subharanjan 整理而成 function set_contenttype($content_type){ return \'text/html\'; } add_filter(\'wp_mail_content_type\',\'set_contenttype\'); if ( $message && !wp_mail($user_email, $title, nl2br($message), $headers) ) 您应该将邮件内容类型设置为“文本/html”。 SO网友:Naveen 在发送电子邮件之前,我已经包括了这些行。现在一切正常$headers = \'MIME-Version: 1.0\' . "\\r\\n"; $headers .= \'Content-type: text/html; charset=iso-8859-1\' . "\\r\\n"; if ( $message && !wp_mail($user_email, $title, nl2br($message), $headers) ) 结束 文章导航