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

前端 未结 4 826
清歌不尽
清歌不尽 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:41

    I've lost about 30 minutes figuring this out.

    If you're using anything that allows you to configure SMTP within WordPress, take it out.

    Then put everything into a function:

    add_action('init','delay_until_init');
    function delay_until_init(){
       // call wp_mail() here
    }
    

提交回复
热议问题