Problems with Phpmailer

Asked

Viewed 308 times

0

I am testing the php script that sends emails using Phpmailer by WAMP with the correct credentials of my SMTP, only every time I open php by wamp it says that it is impossible to send the email and connect to smtp. How do I fix it?

Error:

2018-01-10 01:47:12 SMTP ERROR: Failed to connect to server: Nenhuma conexão pode ser feita porque a máquina de destino as recusou ativamente. (10061) 2018-01-10 01:47:12  SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Não foi possível enviar o e-mail. Informações do erro: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting.

My script: `

$Mailer = new PHPMailer();

$Mailer->IsSMTP();
$Mailer->IsHTML(true);
$Mailer->Charset= 'UTF-8';
$Mailer->SMTPDebug = 2;
$Mailer->SMTPAuth = true;


// Configuracoes smtp
$Mailer->Host = 'smtp.xxx.com.br';
$Mailer->Port = 578;
$Mailer->Username = '[email protected]';
$Mailer->Password = 'supersecreta';

// remetente
$Mailer->From = '[email protected]';
$Mailer->FromName = "Nome";
$Mailer->Subject = "Assunto";

//corpo
$Mailer->Body = '-=-=- Atendimento -=-=-';
$Mailer->AltBody = 'Este é o corpo da mensagem, teste.';

//destinatario
$Mailer->AddAddress('[email protected]');

if($Mailer->Send()) {
   echo "E-mail enviado com sucesso!";
} else {
    echo "Não foi possível enviar o e-mail. ";
    echo "Erro: " . $Mailer->ErrorInfo;
}
?>

Grateful from now on!

  • Related: https://answall.com/q/192302/8063

  • Voce correctly configured your php.ini to send the email on localhost?

  • open_ssl is active in WAMP?

  • The error is in the door: the correct one would be 587.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.