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– Wees Smith
You gave this bool(false) Your message was sent successfully
– Daniel Carcasa
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.– user60252
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
– Daniel Carcasa
N got ;( n of right
– Daniel Carcasa
Is running in local environment or hosting?
– Mauro Alexandre
Using hosting ... kinghost needs to enable something ?
– Daniel Carcasa
I she is a Linux platform!
– Daniel Carcasa