wp_mail() inside AJAX handler never returns

You can do some simple debugging:

  1. Try: wp_mail('youremail@com', '123', '123'); // to see if it will go through
  2. If #1 is not, check if you setup SMTP correctly // install a smpt plugin(wp smtp mail/easy wp smtp) and send a test email
  3. If you can’t send out a test email by plugin, check if your email account has correct rights to send out email from third party (like
    yahoo mail requires “generate an app password”, etc
    https://wpmailsmtp.com/docs/how-to-set-up-the-other-smtp-mailer-in-wp-mail-smtp/#secure-yahoo)
  4. If you use correct method to configure your email settings, but email still doesn’t go out, check if your web server blocks the port 25,
    465 and 587 (telnet the email server with these ports)

My issue is wp_mail is blocking “Reply-To” option in $headers now, everything works fine from my AJAX request as long as “Reply-To” option is removed from $headers. Not sure if you have same issue.