【发布时间】:2017-09-18 01:21:57
【问题描述】:
我有一个安装了 EasySMTP 插件的 wordpress 网站。
我有一个真正的 cron 任务,并且我有非活动的 wp 模拟 cron。
我的 cron 正在运行,但在其中我想发送邮件但无法正常工作。
在我的日志中,我看到:
[20-Apr-2017 14:46:02 UTC] PHP Fatal error: Uncaught exception 'phpmailerException' with message 'Invalid address: (setFrom) wordpress@[domain]' in /home/user/public_html/wp-includes/class-phpmailer.php:1023
Stack trace:
#0 /home/user/public_html/wp-includes/pluggable.php(352): PHPMailer->setFrom('wordpress@[domain...', 'WordPress', false)
#1 /home/user/public_html/wp-content/plugins/innovation-factory/includes/php/functions.php(350): wp_mail('msolla@domain...', 'Tienes 1 ideas ...', '\n\t\t<html>\n\t\t<bo...', Array)
#2 /home/user/public_html/wp-content/plugins/innovation-factory/innovation-factory.php(301): enviarNotificacion('msolla@domain...', 'Tienes 1 ideas ...', NULL, Array, '\n\t\t<html>\n\t\t<bo...')
#3 [internal function]: do_this_hourly()
#4 /home/user/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array('do_this_hourly', Array)
#5 /home/user/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)
#6 /home/des in /home/user/public_html/wp-includes/class-phpmailer.php on line 1023
显然我在 EasySMTP 中有其他 smtp 配置。事实上,我有一个 smtp 托管在其他服务器上,其他域与网页域不同。
如果我从 cron 中调用 do_this_hourly() 函数,它会正确发送电子邮件。我需要做一些与 cron 任务中的邮件不同的事情吗?也许那个 wp-cron.php 还没有加载 EasySMTP?
我的 cron 是用这个命令编写的:
php /home/user/public_html/wp-cron.php
谢谢!
【问题讨论】: