I can not send mail with PHPMailer on the server

0
require 'phpmailer/class.phpmailer.php';
require 'phpmailer/class.smtp.php';

$mail = new PHPMailer();
$mail->setLanguage('pt');

$from = '[email protected]';
$fromName = 'EmailServidor';

$host       = 'servidor.one.com';
$username   = '[email protected]';
$password   = '123456';
$port       = 587;
$secure     = false;

$mail->isSMTP();
$mail->Host         = $host;
$mail->SMTPAuth     = true;
$mail->Username     = $username;
$mail->Password     = $password;
$mail->Port         = $port;
$mail->Secure       = $secure;

$mail->From         = $from;
$mail->FromName     = $fromName;

$mail->addAddress('[email protected]', 'Usuario');

$mail->isHTML(true);
$mail->CharSet = 'utf-8';
$mail->WordWrap = 70;

$mail->Subject = 'Confirmação de Cadastro';
$mail->Body    = 'Email de teste.';
$mail->AltBody = 'Email de teste.';

$send = $mail->Send();

if($send)
    echo 'E-mail enviado com sucesso!';
else
    echo 'Error: '.$mail->ErrorInfo;

So I did the tests on localhost with Xampp and it worked, but when I went to test on the One.com server, it did not send the message and it also did not show any errors. Any idea what that might be?

    
asked by anonymous 12.02.2016 / 21:38

0 answers