Wordpress 在wp_邮件头中设置回复地址
我使用wp_邮件从我的WordPress主题发送通知。如何将回复地址添加到以下wp_邮件脚本中:Wordpress 在wp_邮件头中设置回复地址,wordpress,email,wp-mail,Wordpress,Email,Wp Mail,我使用wp_邮件从我的WordPress主题发送通知。如何将回复地址添加到以下wp_邮件脚本中: $recipient = "recipient@example.com"; $headers = array('Content-Type: text/html; charset=UTF-8','From: MyWebsite <'mywebsite@example.com'>'); $message = 'Here is the sent message';
$recipient = "recipient@example.com";
$headers = array('Content-Type: text/html; charset=UTF-8','From: MyWebsite <'mywebsite@example.com'>');
$message = 'Here is the sent message';
wp_mail( $recipient, 'Here comes the Subject', $message, $headers );
$recipient=”recipient@example.com";
$headers=array('Content-Type:text/html;charset=UTF-8','From:MyWebsite');
$message='这是已发送的消息';
wp_邮件($recipient,‘主题来了’,$message,$headers);
您可以在$headers
数组中设置回复地址。它需要有里面的电子邮件地址,我会建议使用一个名字,以确保一切顺利
$headers[]=“回复:Firstname Lastname”代码>
我为你的电子邮件添加了一个主题。因此,您的代码如下所示:
$recipient = "recipient@example.com";
$subject = "Your subject";
$message = "Here is the sent message";
$headers = array(
'Content-Type: text/html; charset=UTF-8',
'From: MyWebsite <mywebsite@example.com>',
'Reply-To: Firstname Lastname <your@mail.com>'
);
wp_mail( $recipient, $subject, $message, $headers );
$recipient=”recipient@example.com";
$subject=“您的主题”;
$message=“这是发送的消息”;
$headers=数组(
'内容类型:text/html;charset=UTF-8',
“发件人:我的网站”,
'回复:Firstname Lastname'
);
wp_邮件($recipient、$subject、$message、$headers);
非常有效