0

hi everybody!
I'm here because I have a problem with my Contact Form. Aparently is okay but when I check if the messages are sent to my e-mail address is nothing there!
I already have a paid domain (in portuguese 'Amen' internet domains), is why I don't understand the reason for not receiving the messages.

Code for 'index.html' file:

<form action="mail.php" method="post">

<input class="firstbox" type="text" name="cf_name">

<input class="secondbox" type="text" name="cf_email">

<textarea class="thirdbox" name="cf_message">

Edited by Vania Almeida: mistake

2
Contributors
2
Replies
22
Views
4 Years
Discussion Span
Last Post by Vania Almeida
0

Are you running this from a local server or on your development server?

If you are running this from a localhost then you may experience issues for various reasons.
If you are running from a development server, at a glance, i cannot tell what the issue may be besides the following.

I believe you need the

<input type="submit">

Edited by Red_Rain: details

0

unfortunately, iam running on my development server:

<!-- file.htm-->
<form action="mail.php" method="post"> 
<input class="firstbox" type="text" name="cf_name">
<input class="secondbox" type="text" name="cf_email">
<textarea class="thirdbox" name="cf_message"></textarea>
<input class="submit" type="submit" value="Send">
</form> 



//file.php
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];

$mail_to = 'something@something.com';
$subject = 'Message from a site visitor '.$field_name;

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

$headers = "MIME-Version: 1.1\r\n";
$headers .="Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: $field_email\r\n";
$headers .= "Return-Path: $field_email\r\n";

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

if ($envio) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'index.htm';
</script>
<?php
}else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to something@something.pt');
window.location = 'index.htm';
</script>
<?php
}
?>

Edited by Vania Almeida

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.