2
I’m with a website where the server just block sending email from another provider, only allowing sending with the email from the domain itself, I made the change from FROM to an email from my domain and it worked, but the email received appears with the sender that andmail that I changed, I would like to know if it has to change to appear the completed email form, remembering that it has to be only in the view, because the sending has to be with the email of the provider because another is blocked, follows the code that I am using:
<?php
$nome = $_POST['nome'];
$email = $_POST['email'];
$assunto = $_POST['assunto'];
$msg = $_POST['mensagem'];
$to = "[email protected]";
$subject = "Formulário de Contato";
$menssage = "<strong> Nome: </strong> $nome <br/><br/> <strong> E-mail: </strong> $email <br/><br/> <strong> Assunto: </strong> $assunto <br/><br/> <strong> Mensagem: </strong> $msg";
$header = "MIME-Version: 1.0\n";
$header .= "Content-type: text/html; charset=iso-8859-1\n";
$header .= "From: $to\n";
mail($to, $subject, $menssage, $header);
echo "Mensagem enviada com sucesso";
?>
Try to print what the $email variable is receiving. To make sure that the information that is coming in your php is correct. echo $email;
– Fred
$email is what comes from the form, it was previously configured for the $to variable to receive this information, but when changing the server configuration started to show authorization error, I had to change $to an e-domain mail, but wanted to continue to appear in the sender the contents of $email
– Rogerio Santana