繁体   English   中英

无法使用wp_mail()发送邮件

[英]unable to send mail using wp_mail()

我正在尝试使用以下代码使用wp_mail发送邮件:

$headers[] = 'From: Singhal Competition Classes <example@singhalcompetitionclasses.com>';
        $headers[] = 'Content-Type: text/html; charset=UTF-8';
        $messg = "Hi $user_id .... <br/><br/>Thank You for taking the online exam. Your Score card is as follow : <br/><br/><table><tr><td>
        Total Correct Answer :</td><td> $correct_ansq </td></tr>
        <tr><td>Not Given Answer  </td><td> $no_ans </td></tr>
        <tr><td> Total Wrong Answer </td><td> $wrong <br/></td></tr>
        <tr><td> Percentage </td><td> $result % </td></tr>
        <tr><td>Result </td><td> $result</td></tr></table>
        ";
        $to_mail = $useremail;
        $subject = "Online Exam Score Card";
        wp_mail( $to_mail, $subject, $messg, $headers );

我有真实的wp debug但是完成动作后我没有出现错误

我的收件箱或垃圾邮件中都没有收到任何邮件

可能是以下错误

这是一个很好的示例: http : //www.tutorialspoint.com/php/php_sending_emails.htm

打开php.ini,填写SMTP和Sendmail部分,以及您的服务器名称,密码和电子邮件地址。

From website.

[mail function]
; For Win32 only.
SMTP = smtp.secureserver.net

; For win32 only
sendmail_from = webmaster@tutorialspoint.com

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM