Contact form using mail instead of wp_mail

  • Posted in : Read WP
  • angelcosta
    Participant

    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”.

    serkan
    Moderator

    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

    angelcosta
    Participant

    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.

    serkan
    Moderator

    Hi,
    If you have a problem with the default contact form, I suggest you use contact form 7 or ninjaform plugin.
    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register