How do I get the contact form to send using wp_mail? I tried modifying the code from mail to wp_mail( $to, $subject_prefix . ‘ ‘ . $subject, $body, $headers );
But the icon never seems to send the message and keeps “bouncing”.
Hi @angelcosta;
Can you deactivate all your plugin and try it again.Your host may have disabled the mail() function. It must be enabled on your server. If still you have the same problem, you can use Ninja Forms alternatively instead of the default contact form.
Thanks
That’s not the issue. The email arrives, but sent from the server.
If you’re in WP, you should only send mail using wp_mail.
I have a smtp config to send through sendgrid. SO if I use mail I’m gonna be use my server’s postfix/exim config. While if I use wp_mail I’m gonna be sending through sendgrid.