admin管理员组文章数量:1405882
I am developing a simple PHP script that will send emails to users. The script is located outside of WP directory and its run through a cronjob. Example cron job call:
php /PATH/TO/SCIRPT/script.php >> /PATH/TO/SCIRPT/history.log
and here’s part of the code:
<?php
require_once "/PATH/TO/WP/wp-load.php";
$res = wp_mail('email', 'title', 'body');
When I use PHP CLI to run the script $res
is always false. But if I run the same script from the web it works just fine.
Below are the server details: ubuntu 16.04lts up-to-date with php 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Any help will be much appreciated.
本文标签: wp mailUsing wpmail() function outside of WordPress and through PHP CLI
版权声明:本文标题:wp mail - Using wp_mail() function outside of WordPress and through PHP CLI 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744909676a2631836.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论