I can understand tags a bit, also I´ve successfully edited a CMS named GetSimple and all works fine (few months ago). Now, after a couple of months I´ve started with this and cant go through...
I've got the massage of a successful send... "Thank you for contacting us. We will be in touch with you very soon. " but I didn't receive the mail. I've tried different HTML and PHP examples from the internet, but it's the same problem.
HTML
<form method="POST" action="send.php" class="left" enctype="text/plain">
<input type="hidden" name="form-name" value="contact" />
<fieldset>
<label for="your_name">YOUR NAME *</label><input type="text" id="your_name" name="your_name" class="required" /><br/>
<label for="your_email">YOUR email *</label><input type="text" id="your_email" name="your_email" class="required email" /><br/>
<label for="current_site">current site</label><input type="text" id="current_site" name="current_site" /><br/>
<label for="estimated_budget">estimated budget</label><input type="text" id="estimated_budget" name="estimated_budget" /><br/>
<label for="project_description">project description</label> <textarea id="project_description" name="project_description"></textarea><br/>
<!--<input type="submit" value="send" id="sendbutton"> -->
<button class="defaultButton small" id="quotebutton"><span class="buttonLabel">Send</span></button>
</fieldset>
</form>
PHP named "send.php"
<?php
if(isset($_POST['email'])) {
$email_to = "mymail@gmail.com";
$email_subject = "example subject";
$your_name = $_POST['your_name']; // required
$your_email = $_POST['your_email']; // required
$error_message = "Please enter valid e-mail adress";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
}
$email_message = "Form details below.
";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Name: ".clean_string($your_name)."
";
$email_message .= "Mail: ".clean_string($your_email)."
";
$email_message .= "Current site: ".clean_string($current_site)."
";
$email_message .= "Estimated budget: ".clean_string($estimated_budget)."
";
$email_message .= "Project description: ".clean_string($project_description)."
";
// create email headers
$headers = 'From: '.$your_email."
".
'Reply-To: '.$your_email."
" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
}
<!-- place your own success html below -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
die();
?>
According to your script, the submit button need to contain name value 'email'
<input type="submit" value="send" id="sendbutton">
so the fix is:
<input type="submit" value="send" name="email" id="sendbutton" />
Remove the html note tags from your form. the full code:
<form method="POST" action="send.php" class="left" enctype="text/plain">
<input type="hidden" name="form-name" value="contact" />
<fieldset>
<label for="your_name">YOUR NAME *</label><input type="text" id="your_name" name="your_name" class="required" /><br/>
<label for="your_email">YOUR email *</label><input type="text" id="your_email" name="your_email" class="required email" /><br/>
<label for="current_site">current site</label><input type="text" id="current_site" name="current_site" /><br/>
<label for="estimated_budget">estimated budget</label><input type="text" id="estimated_budget" name="estimated_budget" /><br/>
<label for="project_description">project description</label> <textarea id="project_description" name="project_description"></textarea><br/>
<input type="submit" name="email" value="send" id="sendbutton">
</fieldset>
First i think your missing some headers look at those
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "
";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "
";
$headers .= 'Cc: birthdayarchive@example.com' . "
";
$headers .= 'Bcc: birthdaycheck@example.com' . "
";
2nd check if its true or false when calling the mail function
if( mail($email_to, $email_subject, $email_message, $headers)!==true)
{
die('Fail to send');
}
die('Sucess');
}