Contact form not working

Hi there,
I am a newbee to php and working on a site…had this code of contact form and its not working… :frowning: Can any one help?? its urgent :-[

[php]<?php
$field_name = $_POST[‘cf_name’];
$field_email = $_POST[‘cf_email’];
$field_phonenumber = $_POST[‘cf_phone’];
$field_message = $_POST[‘cf_message’];

$mail_to = ‘yash,[email protected]’;
$subject = 'Message from a site visitor '.$field_name;

$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Phone: '.$field_phonenumber."\n";
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";

$mail_status = mail($mail_to, $subject, $body_message, $headers);

if ($mail_status) { ?>

<?php } else { ?>
<script language="javascript" type="text/javascript">
	alert('Message failed. Please, send an email to [email protected]');
	window.location = 'contact.html';
</script>
<?php } ?>[/php]

Whats not working?

After submitting the form the mail is not delivered and i am getting the alert message of message failed which i had wrote in the code in javascript. Dunno what’s wrong with it…

to the best of my knowledge, comma’s are not allowed in email addresses (unless quoted - bad idea!)

with that said:
[php]$mail_to = ‘yash,[email protected]’; // << should there be a comma here?[/php]

Hope that helps.
Red :wink:

Opps…ok… lemme check ;D

Nopes…its still not working… the contact form is placed on www.techiguys.com… u can check it out there wats the error

Sponsor our Newsletter | Privacy Policy | Terms of Service