Using wp_mail() function outside of WordPress and through PHP CLI
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 … Read more