PHPMailer does not send email by localhost

0

Hello, I have a test page in php in it I have the following taken:

<?php
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'mail.wsmtec.com.br';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'Minhasenha';
$mail->Port = 587;
$mail->IsHTML(true);
$mail->From = '[email protected]';
$mail->FromName = 'AndroclesMail';
$mail->addAddress('[email protected]');
$mail->Subject = 'E-mail PHPMailer Wsm';
$mail->Body = '<h1>Mensagem enviada via PHPMailer Wsm</h1>';
if($mail->Send()):
    echo 'Enviado com sucesso !';
else:
    echo 'Erro ao enviar Email:' . $mail->ErrorInfo;
endif;
?>

This code works in the cloud, but in localhost it does not send the email and if you want an error appears, what can I do for this one?

Thank you!

    
asked by anonymous 06.03.2017 / 15:56

0 answers