WP – not sending email

wp_mail() uses phpMailer which defaults to localhost so if your development server is not configured as a mail server, the email won’t fly. Use the ‘wp_mail_failed’ action hook to get the WP_Error that’s thrown so you can further troubleshoot the problem.

wp_mail() function doesn’t send email in Ajax mode

@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 … Read more

Using wp_mail in functions.php

You need to supply or line breaks for your header fields. For example: $headers = “From:” . $from . PHP_EOL; Or put the header fields into an array, in which case you don’t need to add the line breaks manually. $headers[] = “From:” . $from; Email headers are not ‘normal’ text. Those line ending are … Read more

adding Recipient to wp_email() is not working?

Seem like You are not using the correct variable name in $status = wp_mail( $ecard_recipient, $subject, $message, $headers ); You are getting email of recipient in $recipient and in wp_mail() function you are passing another variable for recipient email. So, i think this must be the issue you are getting empty variable.