Form php redirecting to e-mail

Asked

Viewed 120 times

0

Can someone help me with a mistake I’m having with a form ....

<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <title>enviando E-Mail</title>
    </head>
    <body>
        <?php
        $nome=$_POST['nome'];
        $email=$_POST['email'];
        $assunto=$_POST['assunto'];
        $mensagem=$_POST['mensagem'];   
        ?>  
        <?php 

            $to = "[email protected]";
            $subject = "$assunto";
            $message = "<strong>Nome:</strong> $nome<br /><br /><strong>E-Mail:</strong> $email<br /><br /><strong>Assunto:</strong> $assunto<br /><br /><strong>Mensagem</strong> $mensagem<br /><br />";
            $header = "MINE-Version: 1.0\n";
            $header .= "Content-type: text/html; charset=iso-8859-1\n";
            $header .= "From: $email\n";
            mail($to, $subject, $message, $header);
            echo "Mensagem enviada com sucesso";
        ?>
    </body>
</html>

When you press the Send button of the message message sent successfully but do not send the email :( what can be ?

  • puts a var_dump(mail($to, $subject, $message, $header)); to see if the error

  • You gave this bool(false) Your message was sent successfully

  • Your code only has a problem, by the way 2 problems, first $Subject = "$subject";deve ser$Subject = $subject;`. second use gmail, this thing, I’m tired of seeing that it gives problems. I tested your code the way it is on my server and it worked perfectly. The problem is in gmail that does not run any script. email, I think should be set up according to what they stipulate, and this I do not know how it is.

  • I put it on the server $Subject = $subject; and I changed the email to Hotmail. It still doesn’t arrive either in the bin or in the main

  • N got ;( n of right

  • Is running in local environment or hosting?

  • Using hosting ... kinghost needs to enable something ?

  • I she is a Linux platform!

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.