Hello, follow the code:
Inicia a classe PHPMailer
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.dominio.com";
$mail->Username = '[email protected]'; // Usuário do servidor SMTP
$mail->Password = 'senha123'; // Senha do servidor SMTP
$mail->From = "[email protected]";
$mail->FromName = "meu dominio";
$mail->AddAddress("meuemail","meunome");
$mail->IsHTML(true);
$mail->Subject = "Confirmação de pagamento";
$mail->Body = "meu email em html..";
$enviado = $mail->Send();
$mail->ClearAllRecipients();
$mail->ClearAttachments();
if ($enviado) {
echo "E-mail enviado com sucesso!";
} else {
echo "Não foi possível enviar o e-mail.<br /><br />";
echo "<b>Informações do erro:</b> <br />" . $mail->ErrorInfo;
}
Follow the error:
Could not send email.
Error information: SMTP connect () failed. Could not send the email.
Error information: SMTP connect () failed.
Anyway, has this error occurred to anyone? And what was the reason? I already enabled the ssl line there in php.ini that I heard some say it needed ..