最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp_mail function not working in WordPress Plugin Boilerplate

programmeradmin1浏览0评论

I am creating a plugin using WordPress plugin boilerplate (/), I have create a separate file for sending emails under /admin/partials/ directory. but wordpress throw error when I am using wp_mail function in this file. any solution for this?

Fatal error: Uncaught Error: Call to undefined function wp_mail()

I am creating a plugin using WordPress plugin boilerplate (https://wppb.me/), I have create a separate file for sending emails under /admin/partials/ directory. but wordpress throw error when I am using wp_mail function in this file. any solution for this?

Fatal error: Uncaught Error: Call to undefined function wp_mail()

Share Improve this question asked Jan 26, 2020 at 16:30 Sahil BuddhadevSahil Buddhadev 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

If it's undefined, that means you're trying to run wp_mail() before it is loaded. Whatever you've hooked it to is too early. Hook your process to a later action. Essentially, anything like plugins_loaded or later.

发布评论

评论列表(0)

  1. 暂无评论