Jump to content

Send Email


Elie.w

Recommended Posts

i made a contact form for a website and i need to know why i'm not receiving the e-mail when i click send on my formthis is my contact.php document: <?php$field_name = $_POST['firstname'];$field_email = $_POST['yourmail'];$field_message = $_POST['yourmessage'];$toemail = 'elie.w@hotmail.ca';$subject = 'Message from a site visitor '.$field_name;$body_message = 'From: '.$field_firstname."\n";$body_message .= 'E-mail: '.$field_yourmail."\n";$body_message .= 'Message: '.$field_yourmessage;$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) { ?> <script language="javascript" type="text/javascript"> alert('Thank you for the message. We will contact you shortly.'); window.location = 'contact.html'; </script><?php}else { ?> <script language="javascript" type="text/javascript"> alert('Message failed. Please, send an email to elie.w@hotmail.ca'); window.location = 'contact.html'; </script><?php}?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...