I do not understand why the PHP Mailer library does not work on my Localhost. Here's how:
# Envia Emails Para Departamento Escolhido e para o Admin
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'smtp.dominio.com.br'; # 'dominio' é só um pseudo
$mail->SMTPAuth = true;
$mail->SetLanguage('br');
$mail->Username = '[email protected]';
$mail->Password = 'dominio123';
$mail->SMTPSecure = '';
$mail->Port = 587;
And give me the following error:
stream_socket_enable_crypto (): Peer certificate CN = '* .uni5.net' did not match expected CN = 'smtp.domain.com' ''
SMTP is right. In Laravel I also use this same email, username and password and it works. In SMTPSecure I have to remove the TLS
.
But localhost gives this error. I have not tested the network yet.