Form does not send to email (PHP)

1

I have two pages created, index.php and processaForm.php. The first account with the form and the second is responsible for picking up the data and sending it to my email. But despite putting both files on the server (000webhost) and sending, my email (gmail) does not get anything. I'm a beginner so I need all the help I can: D

index.php

<?php

$msg = 0;
@$msg = $_REQUEST['msg'];

?>

<html>

<head>
    <meta charset="utf-8">
    <title></title>
</head>

<body>

    <?php
        if ($msg=="enviado"):
    ?>
    <h1>Mensagem enviada</h1>

    <?php else: ?>

    <fieldset>
        <legend><h3>Formulário de contato</h3></legend>
        <form action="processaForm.php" method="post">
            <label for="name">Nome:</label><br>
            <input id="nome" type="text" name="nome" required><br>
            <label for="telefone">Telefone:</label><br>
            <input id="telefone" type="tel" name="telefone" requerid><br>
            <label for="email">Email:</label><br>
            <input id="email" type="email" name="email" requerid><br>
            <label for="assunto">Assunto:</label><br>
            <textarea id="assunto" name="assunto"> </textarea><br>
            <input type="submit" name="enviar">
        </form>
    </fieldset>

    <?php endif; ?>

</body>

processaForm.php

<?php

$para = "[email protected]";
$assunto = "Consulta agendada";
$nome = $_REQUEST['nome'];
$fone = $_REQUEST['telefone'];
$email = $_REQUEST['email'];
$msg = $_REQUEST['assunto'];

    $corpo = "<strong> Mensagem de contato </strong><br><br>"; 
    $corpo .= "<br><strong> Nome: </strong> $nome"; 
    $corpo .= "<br><strong> Telefone: </strong> $fone";
    $corpo .= "<br><strong> Email: </strong> $email";
    $corpo .= "<br><strong> Mensagem: </strong> $msg";   

    $header = "From: $email Reply-to: $email";
    $header .= "Content-type: text/html; charset = utf-8";

@mail($para, $assunto, $corpo, $header);

header("location:index.php?msg=enviado");
?>
    
asked by anonymous 04.02.2018 / 01:16

0 answers