I used to have my website in another webhost and my contact form worked fine. Now, In x10hosting my form doesn't deliver e-mails and I don't get any message error. My code is the following:
Why is it happening and how to solve it?
Thanks in advance
PHP:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: opep';
$to = 'myemail@live.com.pt';
$subject = 'Contacto Via OPEP';
$human = $_POST['human'];
$body = "Nome: $name\nE-Mail: $email\nMensagem: $message";
if ($_POST['submit'] && $human == '4') {
if (mail ($to, $subject, $body, $from)) {
echo '<p>A sua mensagem foi enviada.</p>';
} else {
echo '<p>Algo correu mal com o envio. Tente novamente.</p>';
}
} else if ($_POST['submit'] && $human != '4') {
echo '<p>Respondeu erradamente à pergunta anti-spam.</p>';
}
?>
Why is it happening and how to solve it?
Thanks in advance