I am not receiving data sent by the user in the email I should receive. Any tips how to solve?

0

I need help. I have a contact form that works but the name, email and message of the person who sends it does not reach the email of the recipient. Where is the error in php? Thank you very much.

PHP

<?
$nome=$_POST['nome'];

$email=$_POST['email'];

$titulo=$_POST['titulo'];

$texto=$_POST['texto'];


$Destinatario="email a receber";


$Titulo="$titulo";


$mensagem1="

Uma mensagem vinda do site !

Algum vistante mandou essa mensagem pelo site.

Nome: $nome

Email: $email

Mensagem: $texto";


mail("$Destinatario","$Titulo", "$mensagem1","From:$email");

?>

html code

<form method="post" action="contacto.php">
      <input type="text"  placeholder="Nome"  required="">
      <input type="text"  placeholder="Email " required="" >
      <textarea  placeholder="Mensagem" requried=""></textarea>         

      <label class="hvr-sweep-to-right">
        <input type="submit" value="Enviar">
      </label>
</form>
    
asked by anonymous 30.05.2016 / 22:21

1 answer

2

Put the code below instead of From:$email

$headers = 'From: '$email . '\r\n' .
    'Reply-To: '. $email . '\r\n' .
    'X-Mailer: PHP/' . phpversion();

leaving the code like this

mail($Destinatario, $Titulo, $mensagem1, $headers);

and the "name" attributes on the form are also missing

    
30.05.2016 / 23:00