I have the following php code, what I want is that I receive in my email from the hosting server the user's message with his email in the place DE: so I can answer it.
$nome = $_POST['nome'];
$email_usuario = $_POST['email'];
$assunto = $_POST['assunto'];
$mensagem = $_POST['msg'];
$tipo_mensagem = isset($_POST['tipo_msg']) ? $_POST['tipo_msg'] : "";
require '../model/PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer(true); // Passing 'true' enables exceptions
try {
$mail->IsSMTP();
$mail->CharSet="UTF-8";
$mail->Debugoutput = 'html';
$mail->SMTPDebug = 2; // Enable verbose debug output // Set mailer to use SMTP
$mail->Host = 'smtp.umbler.com'; // Specify main and backup SMTP servers
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->IsHTML(true);
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'minhasenha'; // SMTP password
$mail->AddReplyTo($email_usuario, $nome); //AQUI vai o reply-to:
$mail->AddAddress('[email protected]');
$mail->Subject = $assunto;
$mail->Body = '<h3>Mensagem: '.$tipo_mensagem.' '.$mensagem.'</h3>';
$mail->send();
return 'Message has been sent';
} catch (Exception $e) {
return 'Message could not be sent. Mailer Error: '.$mail->ErrorInfo;
}
And give me the following error.
SMTP Error: The following recipients failed: [email protected] :: Sender address rejected: not owned by user [email protected]