Ifran 0 Denunciar post Postado Agosto 11, 2015 Se eu uso $mail->Host = smtp.gmail.com; Não aparece nada de erro nem de envio. Parece que o programa para de ler, agr se eu mudar para localhost, ai sim aparecem erros, mas não funciona. Código: <?php require 'PHPMailer/PHPMailerAutoload.php'; $mail = new PHPMailer; $mail->SMTPDebug = 4; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'meuEmail'; // SMTP username $mail->Password = 'minhaSenha'; // SMTP password $mail->Port = 587; // TCP port to connect to $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted $mail->From = 'meuEmail'; $mail->FromName = 'Eu'; $mail->addAddress('Destino', 'Nome dele'); // Add a recipient $mail->addReplyTo('Destino', 'Information'); $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body in bold!'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; if(!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: '. $mail->ErrorInfo; } else { echo 'Message has been sent'; } ?> Se eu trocar $mail->Host = 'smtp.gmail.com' por $mail->Host = 'localhost'; 2015-08-11 13:47:07 Connection: opening to ssl://localhost:587, timeout=300, options=array ( ) 2015-08-11 13:47:09 SMTP ERROR: Failed to connect to server: Nenhuma conex�o p�de ser feita porque a m�quina de destino as recusou ativamente. (10061) 2015-08-11 13:47:09 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Pelo menos mostra os erros, como se o código fosse lido até o final Compartilhar este post Link para o post Compartilhar em outros sites
Beraldo 864 Denunciar post Postado Agosto 11, 2015 É Hostname, não Host Veja a lista das propriedades e seus descrições: http://phpmailer.worxware.com/?pg=properties Compartilhar este post Link para o post Compartilhar em outros sites