Website Contact Form not working, clueless about any error

Hello,

I am new in this forum and I came here with a hope of help. I am working on my own small business website and I am stuck on the Contact Form part. I got a free template, I am working on the content and other part perfectly. But the contact form is sending any mail to my email address. I am able to fill it completely, but there is no email coming in my email address even after editing that form.

Following is the SendContact.PHP form :

[color=“#0000FF”]<?php

$from = "info@XXXXX.com";
$from_name = "DesignHQ";
$subject = "Contact Form";
	
$to = $_POST['email'];

// collect data
$body = "";
foreach($_POST as $key =&gt; $val)
{
	if($key != 'captcha')
		$body .= ucfirst($key).": ".$val."\\r\

";
}

// construct MIME PLAIN Email headers
$header = "MIME-Version: 1.0\

";
$header .= "Content-type: text/plain; charset=utf-8
";
$header .= "From: $from_name <$from>\r
Reply-To: $from_name <$from>\r
Return-Path: <$from>\r
";

// send email
$mail_sent = mail($to, $subject, $body, $header);	

?>
[/color]

======================================================================

I am really clueless about fixing it. Please help me

Regards,

Jatin

Sorry for the very late reply. It was a problem in my PHP code.

Yes, It is.

I got the solution, it is working now.

Thanks Btw… :slight_smile:

Is this just a contact us form that will send an email to you?

I see that you have solved your problem. I’m only posting out of interest because I’ve just had the same problem with my site. Was this a problem with your PHP code or was it (like mine) related to mail configuration and firewall issues?