Hi,
I'm having a problem with a script that sends an email (an enquiry) from the website to an email from the database
The script is the following
if(($m=="regres") && isgoodp($prid) && (isgoodp($date1) || isgoodp($date2)) && isgoodp($name) && isgoodp($mail)){
if(!isgoodp($date1)) $date1=$date2;
elseif(!isgoodp($date2)) $date2=$date1;
$resi="INSERT INTO reservation VALUES(NULL,$prid,'$name','$mail','$adults','$children',CURDATE(),'".retdate($date1)."','".retdate($date2)."','$phone','".nl2br($comm)."',0)";
mysql_query($resi) or die(mysql_error());
$uq=mysql_query("SELECT Email, Title FROM users, property WHERE IDUser=IDOwner AND IDProperty=$prid") or die(mysql_error());
if(mysql_num_rows($uq)>0){
//================SEND MAIL=============
$email=mysql_result($uq,0,'Email');
if(verifie_email($email)){
$date1=strtotime($date1);
$date2=strtotime($date2);
$mail_registr="<html><body><p>Hello, <br>
The person below has sent the following inquiry about
property number <b>$prid</b>. <br><br>
To reply to this inquiry please use your 'reply' button or send an
email to: $mail <br><br>
Name: <b>$name</b><br>
E-mail: <b>$mail</b><br>
Tel: <b>$phone</b><br>
Arrival date: ".date("jS F Y", $date1)."
Departure date: ".date("jS F Y", $date2)."
Adults: <b>$adults</b><br>
Children: <b>$children</b><br>
Further info: <b>".nl2br($comm)."</b> <br><br>
<p>This inquiry is also saved in your Customer Admin Area on our website.<br>
Best regards,<br>
XYZ <br>
</p></body>
</html>";
$subj = "Guest inquiry from XYZ";
$header = "Return-Path: $mail";
$header .= "Reply-to: $mail\r\n";
$header .= "From: $name <$mail>\r\n";
$header .= "Content-Type: text/html; charset=iso-8859-1;\r\n\r\n";
mail ($email,$subj,$mail_registr,$header);
//===================END SEND MAIL
$mess=13;
}else $mess=15;
}
}
elseif($m=="regres") $mess=6;
It should enter the data (enquiry details) in the database and after that send these details to the email of the property owner. It enters the data in the database successfully but doesn't send the email. Could you please help me with this?
Thanks,
Roman