PHP:当有人回复邮件时,将回复文本添加到邮件中


PHP : Add reply-to text to the mail when someone replies to mail

我正在向客户发送带有回复电子邮件id的邮件,当客户单击回复时,应该添加一个预定义的文本以包含正文,然后客户将键入包含。如何做到这一点?

您需要设置标题才能传递发件人电子邮件:

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "'r'n" .
    'Reply-To: webmaster@example.com' . "'r'n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>