简体   繁体   English

PHP自动回复电子邮件

[英]PHP auto-reply email

Newbie at Php but managed to get this up, running and working great. Php的新手,但设法使其运行,运行和运行良好。 They now would like to have an auto reply email sent to the patient filling out the online form. 他们现在希望有一封自动回复电子邮件发送给患者,填写在线表格。 I don't care what I add…It just docent seem to sen d any rely emails. 我不在乎我要添加什么……只是象似的感觉到任何依赖电子邮件。 Could anyone please help me out before I start asking for some meds. 在我开始要求药物之前,任何人都可以帮助我。 :/ Thank you so much. :/ 非常感谢。

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$name_of_medication = $_POST['name_of_medication'];
$strength_dosage = $_POST['strength_dosage'];
$amount_taken_daily = $_POST['amount_taken_daily'];
$would_like_a = $_POST['would_like_a'];
$would_like = $_POST['would_like'];
$pharmacy_address = $_POST['pharmacy_address'];
$message = $_POST['message']; //-- all above info to be filled out by patient --//

$formcontent=" From: $name \n Name of Medication: $name_of_medication \n Strength 
/ Dosage: $strength_dosage \n Amount Taken Daily: $amount_taken_daily \n I would like a: 
$would_like_a \n I would like: $would_like \n Pharmacy Name: $pharmacy \n 
      Pharmacy  Address:
$pharmacy_address \n Message/Notes: $message";
$recipient = "prescription@mydoctor.com";
$subject = "Prescription Request Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Your Prescription Request has been received and will be processed within 48 hours.
  Thank you!" ;

//-- all above info to be emailed to our doctor's office --//

$formcontent2=" From: $name \n Name of Medication: $name_of_medication \n Strength 
 / Dosage: $strength_dosage \n Amount Taken Daily: $amount_taken_daily \n 
 I would like a:
$would_like_a \n I would like: $would_like \n Pharmacy Name: $pharmacy \n 
Pharmacy Address: $pharmacy_address \n Message/Notes: $message";
$recipient = $_POST['email'];
$subject = "Prescription Request Form";
$mailheader = "prescription@mydoctor.com";
mail($_POST['email'], $subject, $formcontent, $mailheader);

//-- all above info to be auto (auto reply) emailed to patient --//

?>

也许将您的$ mailheader变量更改为此

$mailheader= "From: prescription@mydoctor.com";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM