@T.Todua :
Ok and when I use your way it doesn’t deliver the email. It doesn’t send email in Ajax function and it’s my problem exactly
add_action( 'wp_ajax_ABCABCABC', 'wpse8170_phpmailer_init' );
function wpse8170_phpmailer_init() {
//it doesn't send/deliver in a Ajax function
wp_mail("[email protected]", "test", "test");
}
But when I use wp_mail() in post-back page it works fine for example when put it in functions.php file it sends/delivers the email:
//functions.php
//It sends in this mode
wp_mail("[email protected]", "test", "test");
It’s my problem.