Hi all i have this script:
include 'db.php';
$sql = mysql_query("INSERT INTO customer (cust_fname, cust_sname, cust_address, cust_postcode, cust_tel, cust_email, cust_cc)
VALUES('$cfname', '$csname', '$caddress', '$cpostcode', '$ctel', '$cemail', '0') ");
if(!$sql){
echo 'There has been an error creating your account. Please contact the webmaster.';
} else {
echo 'Your question was sucessful added. You will receive an email confirming this.';
$sql2 = mysql_query("SELECT cust_no FROM customer WHERE cust_fname = '$fname' AND cust_sname = '$sname' AND cust_address = '$address' AND cust_postcode = '$postcode' AND cust_tel = '$telephone' AND cust_email = '$email'");
$subject = "Your Question to PcRuS";
$message = "Dear $cname $csname,
Thank you for registering at out our website, [url]http://www.pc4us.co.uk[/url]
You will not have to submit your information again
Your Customer Numer: $cust_no
Please keep this email save as you will require your coustomer number to log into the site.
We will be in touch sortly
Thanks!
The Webmaster
This is an automated response, please do not reply!";
mail($email, $subject, $message, "From: PcRuS Webmaster<admin@pcrus.com>\nX-Mailer: PHP/" . phpversion());
}
Now i get the message saying that the info has been added and the information adds into the database but the mail doesnt work, anyone have any suggestions?