1
I am unable to send this form to e-mail, I followed a tutorial and it did not work!
HTML
<body>
<div class="col-md-6 centro" method="POST">
<img class="imagem" src="AMB.png">
<form action="enviar.php">
<div class="form-group">
<label for="nome">Nome Completo:</label>
<input type="text" class="form-control" id="nome">
</div>
<div class="form-group">
<label for="cpf" onblur="TestaCPF(this)">CPF:</label>
<input type="number" class="form-control" id="cpf">
</div>
<div class="form-group">
<label for="crm">CRM:</label>
<input type="number" class="form-control" id="crm">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email">
</div>
<button type="enviar" class="botao btn btn-default">Enviar</button>
</form>
</div>
</body>
PHP
<?php
$para = '[email protected]';
$nome = $_POST['nome'];
$cpf = $_POST['cpf'];
$crm = $_POST['crm'];
$email = trim($_POST['email']);
$mensagem = '<strong>Nome: </strong>'.$nome;
$mensagem .= '<br> <strong>CPF: </strong>'.$cpf;
$mensagem .= '<br> <strong>CRM: </strong>'.$crm;
$mensagem .= '<br> <strong>Email: </strong>'.$email;
$headers = "MIME-Version: 1.1\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$headers .= "From: $email\r\n";
$headers .= "Return-Path: $para \r\n";
$envio = mail($para, $nome, $cpf, $crm, $mensagem, $headers);
echo "Formulário enviado com sucesso!";
?>
Is there an error message? If so, please add the question. You know you need to have the server smtp correctly configured?
– Florida