- Edited
Hello.
I have a working PHP Mail Form (thanks to this site). But when I recieve e-mails from users, there´s an issue.
If someone for instance writes "isn´t" in the textarea it shows up as "isn´t" in the mail that I recieve.
Here´s the header section of my HTML-file where the UTF is:
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Here´s the HTML-form:
<form class="ajax-form" data-message-class="colors-e background-95 border heading" action="contact-form-handler.php" method="post" novalidate="novalidate" >
<div class="row">
<div class="col-md-6 control-group">
<div class="alt-placeholder">Name</div>
<input type="text" name="name" value="" size="40" placeholder="Name" data-validation-required-message="Please fill the required field." required>
<div class="help-block"></div>
</div>
<div class="col-md-6 control-group">
<div class="alt-placeholder">Email</div>
<input type="email" name="email" value="" size="40" placeholder="Email" data-validation-required-message="Please fill the required field." required>
<div class="help-block"></div>
</div>
<div class="col-md-12 control-group">
<div class="alt-placeholder">Message</div>
<textarea name="message" placeholder="Message" data-validation-required-message="Please fill the required field." required></textarea>
<div class="help-block"></div>
</div>
<div class="col-md-12 form-actions">
And here´s the PHP:
<?php
$myemail = 'contact@something.com';
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
$successMessage = 'Message successfully sent!';
{
$to = $myemail;
$email_subject = "Contact Form: $name";
$email_body = " Noen har sendt en melding fra hjemmesiden! \n\n".
" \n Navn: $name \n E-post: $email_address \n\n\n Melding: \n\n $message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
}
echo($successMessage);
?>
Hope you guys can help me