wordpress - 来自地址的 Wordpress smtp 邮件不起作用
问题描述
我wp_mail_smtp
用于在 WordPress 中发送邮件,它的工作正常期望一件事我已经定义了来自电子邮件:abc@mysite.com和来自名称:我的站点和用于 smtp 身份验证的用户名密码是:someemail@example.com和我的密码邮件编号。
现在的问题是,当我发送邮件时,我收到的邮件标题比
mysite< someemail@example.com > 它应该是 mysite< abc@mysite.com > 我还设置了来自名称和来自邮件的过滤器,如下面的代码
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from($old) {
return 'abc@mysite.com';
}
function new_mail_from_name($old) {
return 'mysite.com';
}
我的邮件代码是
$headers = 'From: abc@mysite.com ' . "\r\n";
$to = "admin@test.com"
$send_subject = "Mail Subject"
$message .= "Some message";
wp_mail( $to, $send_subject, $message,$headers );
请告诉我我做错了什么,以便我可以正确接收邮件标题
谢谢
解决方案
推荐阅读
- swift - TableView中的图像在出现时动画
- android - 您好,我正在尝试为 Flutter 设置我的 Android 设备。梯度错误
- angular - Angular 9新项目-ng服务时未加载应用程序根
- javascript - 刷新后的角度重定向并阻止通过直接 url 访问
- verilog - 如何在verilog中将LUT解包到逻辑单元中
- css - Chrome 上不支持内联 css 剪辑路径
- android - imageCache.clear() 在 Flutter 中的 ListView 上不起作用
- reactjs - React 本机元素类型无效。需要一个字符串或类/函数,但未定义
- android - Flutter Signed APK build 中无法打开 zipalign 失败错误
- sql-server - 寻找编写代码逻辑的更好方法