PHP MAILER - Error: The following recipients failed

0
$email = $_REQUEST['email'];

$mail->IsSMTP(); 
$mail->Host = "smtp.***.com.br";
$mail->SMTPAuth = true; 
$mail->Username = 'contato@***.com.br'; 
$mail->Password = '******'; 


$mail->From = $email;  <<<<<<<<<<<<<<ERRO>>>>>>>>>>>>>>>>>>
$mail->Sender = "[email protected]"; 
$mail->FromName = "Contato - www.contato.com.br";

When I use I put the direct value in ($ mail- > From)="[email protected]". It works normally, when I put a variable, of the error, can the handcuff help me?

    
asked by anonymous 15.04.2015 / 20:11

2 answers

2

You have to use it like this:

$mail->addAddress("[email protected]"); // email do destinatario (para quem a mensagem devera ser enviada).

$mail->addReplyTo('[email protected]', 'First Last'); // Aqui define um endereço(email) alternativo para resposta.
    
15.04.2015 / 20:32
0

I found the solution.

The method needed to be replaced for:

$mail->AddReplyTo($email, $nome);
    
15.04.2015 / 20:28