Using wp_mail() instead of mail() in Wordpress does not work

前端 未结 4 816
清歌不尽
清歌不尽 2021-01-23 08:00

Since PHP mail has been disabled on my server it has stopped a theme integrated contact form from working.

The theme is called Boldy and it has its own sendmail.php file

4条回答
  •  灰色年华
    2021-01-23 08:32

    By default, the Wordpress function wp_mail() uses PHPs internal mail() function so the change you've made won't fix the issue.

    If your web server has disabled the standard PHP mail() function then you will need to switch over to using SMTP for sending your emails.

    There's a few different ways to achieve this, but the easiest method I've found has been to use the Easy WP SMTP plugin. Once installed, you'll need to configure the plugin to use the login details for your SMTP server. If you hvae a Gmail address, you can use those details for setting it up.

    EDIT: You still need to switch your code over to using the wp_mail() function which will automatically use SMTP (if you have the WP SMTP plugin installed).

提交回复
热议问题