我已经尝试了几个人的答案,没有一个有效。我有一个运行良好的 phpmail 功能,我只想为其添加一个自动回复功能,以便可以立即通知发件人已收到提交。
我的代码是这样的:
<?php
$mail_to_send_to = "contact@matejkadesign.com";
$your_feedbackmail = "form@matejkadesign.com";
$sendflag = $_REQUEST['sendflag'];
if ( $sendflag == "send" )
{
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $your_feedbackmail" . "\r\n" . "Reply-To: $name <$email>" . "\r\n" ;
$a = mail( $mail_to_send_to, "Contact request", $message, $headers );
if ($a)
{
print("Message sent, thank you! You can send another");
} else {
print("Message wasn't sent, please check that your email was filled in properly");
}
}
?>
我想在自动回复中这样说:
Thank you for contacting us. This is an automatically generated reply confirming your submission. We will get back to you as soon as possible.
Sincerely,
John Doe