form mail

I am trying to send a simple web form from a site I just moved to Host Gator. Can anyone tell me what I am doing wrong? My file name is formail2.html. When I name it with the extension .php I get a 404 error. When I change it to .html it runs, displays the html message but does not send the email.

Please help. Thank you.

contents of formail2.html:

we are about to send you mail
[php]<?php

$sendto= "[email protected]";
$subject=“test subject”;
$body=“this is the body”;

$headers = “From: [email protected]\r\n”;
$headers .= " Reply-to: [email protected]\r\n";

mail($sendto, $subject, $body, $headers);
header(“Location:index.html”);
?>[/php]

Thank you for contacting us. We will be in touch with you very soon.

If you are not getting any errors or seeing PHP code (on the HTML page) the mail is likely being block for another reason.

I have no filters or blocks on the email account I am sending to and nothing in my spam folder. Any other ideas? Or places I can check for blocks?

The code all looks good to you?

Thanks.

The code looks fine. What I mean is that Host Gator may have restrictions on what you can set for mail headers.

Google search found this perhaps it will help you:

http://support.hostgator.com/articles/specialized-help/technical/php-email-from-header

Sponsor our Newsletter | Privacy Policy | Terms of Service