Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 在wp_邮件头中设置回复地址_Wordpress_Email_Wp Mail - Fatal编程技术网

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';

我使用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';
        
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);

非常有效