我们的服务器当前正在自动将返回路径设置为{[email protected]}。在用PHP发送电子邮件时,我可以通过执行以下操作来覆盖此内容:
$return = \'<[email protected]>\';
$additional = "-f$return";
mail($to,$subject,$message,$headers, $additional);
我的问题是WordPress没有像本机PHP邮件函数那样提供添加额外\\u参数的功能。是否有一个解决方法可以让这项工作正常进行?以下是我的WordPress插件用于发送电子邮件的实际代码:
$headers = array(
\'From: Eden Mobility <[email protected]>\',
\'Content-Type: text/html; charset=UTF-8\',
\'Return-Path: <[email protected]>\'
);
wp_mail( "[email protected]", \'Your \' . $item . \' renewal is almost due\', $template, $headers ); // LIVE
我注意到的一件事是,我现在在提交邮件时收到警告:
PHP Warning: escapeshellcmd() has been disabled for security reasons in /home/user/domain.co.uk/wp-includes/class-phpmailer.php on line 1442
[02-Feb-2018 15:25:54 UTC]