我将使用此代码发送简单邮件。但是执行条件的时间将是错误的。(其他部分)
$fname=$_POST['form_name'];
$email=$_POST['form_email'];
$phone=$_POST['form_phone'];
$subject=$_POST['form_subject'];
$remarks=$_POST['form_message'];
$message = "Hi you have a new Enquiry"."\r\n". "See Details below". "\r\n" . "Name :".$fname." "."\n". "Email :".$email. "\n"."Contact Number : ".$phone."\n"."Subject Number : ".$subject."\n"."remarks :".$remarks."\n";
$subject='test message ' .$email;
$message=$message;
$headers= 'From: mail@test.in' . "\r\n" .'Reply-To: mail@test.in' . "\r\n" .'X-Mailer: PHP/' . phpversion();
$headers.= 'MIME-Version: 1.0' . "\r\n";
if(mail("test@gmail.com",$subject,$message,$headers)) {
echo '<div class="text-center"> <p class="success" style="color: #d1287a; font-size: 26px;
padding-top: 30px;">Thank you for Registering with us, We will Contact you Soon! </p></div>';
} else {
echo 'Error while sending mail,Please try again later';
}
}