我跑 VPS 哪些主机多个域. 从这些域发送邮件一直是棘手的. 我一直使用 WP SMTP 邮件WordPress插件来解决此, 但我希望得到一个适当的修复. 经过大量阅读后,我找到了合适的解决方案
The problem is that the “from” address and the “return to” address have to match and unless you know how to fully do the code they wont.
规范非WordPress网站
$消息=“你在这里的消息”; $发件人= 'you@yourdomain.com'; $标题=“从: “ . $寄件人 . "\[R n" . '回复: “ . $寄件人 . "\[R n" . “返回路径: “ . $寄件人; $主题='你的主题; $成功=邮件('recepient @邮件', $学科, $信息, $头, "-f " . $寄件人);
注, 关键的部分是最后一部分, the extra value AFTER the headers. This is the extra parameters part and we specify the sender again with a ‑f command
For more info on this there is a good article at Pupunzi
为WordPress
Simply add the following code to your theme’s functions.php or create a custom plugin with the code
类email_return_path { 功能__construct() { ADD_ACTION( 'phpmailer_init', 排列( $这, '固定' ) ); } 功能修复( $PHPMailer的 ) { $phpmailer->Sender = $phpmailer->From; } } 新email_return_path();
由于 Kinamo 用于顶端
你怎么看? 请给我们一个评论如下! 如果您想订阅,请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.
发表评论