I downloaded this form http://css-tricks.com/examples/NiceSimpleContactForm/. my client use free gmail account and he want to get all mail in his gmail account through contact us form. I tested this but mail not coming to gmail.
This is the code of form php
I just changed this
to this
What is the problem, what is the purpose of $EmailFrom? user will fill their own email in form.
This is the code of form php
<?php
$EmailFrom = \"chriscoyier@gmail.com\";
$EmailTo = \"CHANGE-THIS@YOUR-DOMAIN.com\";
$Subject = \"Nice & Simple Contact Form by CSS-Tricks\";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (!$validationOK) {
print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.htm\\">\";
exit;
}
// prepare email body text
$Body = \"\";
$Body .= \"Name: \";
$Body .= $Name;
$Body .= \"\n\";
$Body .= \"Tel: \";
$Body .= $Tel;
$Body .= \"\n\";
$Body .= \"Email: \";
$Body .= $Email;
$Body .= \"\n\";
$Body .= \"Message: \";
$Body .= $Message;
$Body .= \"\n\";
// send email
$success = mail($EmailTo, $Subject, $Body, \"From: <$EmailFrom>\");
// redirect to success page
if ($success){
print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=contactthanks.php\\">\";
}
else{
print \"<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.htm\\">\";
}
?>
I just changed this
$EmailFrom = \"chriscoyier@gmail.com\";
$EmailTo = \"CHANGE-THIS@YOUR-DOMAIN.com\";
to this
$EmailFrom = \"myname@gmail.com\";
$EmailTo = \"myname@gmail.com\";
What is the problem, what is the purpose of $EmailFrom? user will fill their own email in form.