Ajax 有谁能告诉我我是如何';你能用wordpress中的phpMail发送电子邮件吗?

Ajax 有谁能告诉我我是如何';你能用wordpress中的phpMail发送电子邮件吗?,ajax,wordpress,phpmailer,Ajax,Wordpress,Phpmailer,我已经厌倦了许多解决方案和张贴代码,但我没有得到任何回应,请帮助我。我的函数甚至没有给出一个错误 add_action( 'phpmailer_init', 'New_Mail'); ini_set('display_errors', 1); error_reporting(E_ALL); function New_Mail($phpmailer){ print_r($phpmailer); die(); } 您可以安装类似“”的插件并正常使用。这不是重新发明轮子。您使用的是PHPM

我已经厌倦了许多解决方案和张贴代码,但我没有得到任何回应,请帮助我。我的函数甚至没有给出一个错误

add_action( 'phpmailer_init', 'New_Mail');

ini_set('display_errors', 1);
error_reporting(E_ALL);

function New_Mail($phpmailer){

print_r($phpmailer);

die();

}

您可以安装类似“”的插件并正常使用。这不是重新发明轮子。

您使用的是PHPMailer插件吗?感谢您的帮助,这是我现在正在使用的功能
add_action('PHPMailer_init','new_email');函数new_email($phpmailer){echo“这里是”;die();$phpmailer->isSMTP();$phpmailer->Host='smtp.example.com';$phpmailer->SMTPAuth=true;//强制它使用用户名和密码验证$phpmailer->Port=25;$phpmailer->Username='yourrusername';$phpmailer->Password='yourpassword'}
它既不显示任何错误,也不回显任何内容。