Use wp_mail() from oputside of WP and through CLI
-
Hello,
I am developing a simple php sccript that will sent emails to users.
The script is located outside of WP directory and its run through cronjob.
Example cron job call:
php /PATH/TO/SCIRPT/script.php >> /PATH/TO/SCIRPT/history.log
and here’s part of the code:
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 web it woks just fine.
Any help will be much appritiated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Use wp_mail() from oputside of WP and through CLI’ is closed to new replies.