I can not send emails from my application, this is with the phpMailer library, when sending emails it shows me the error message SMTP: Could not connect to the SMTP server.
Enter all the parameters of the server, which is smtp.gmail.com, user, password, but it does not allow me to send emails.
para verificar la configuracion SMTP
Test generado por : '.$_SESSION["NOMBREFUNCIONARIO"]; $mail = new PHPMailer(true); $mail->IsSMTP(); $mail->SMTPDebug = $Debug; $mail->SetLanguage('es'); $mail->MsgHTML($body); $mail->SMTPAuth = $SMTPAuth; $mail->Port = $Port; switch ($SMTPSecure) { case 'SSL': { $mail->SMTPSecure = 'ssl'; } case 'TLS': { $mail->SMTPSecure = 'tls'; } } $mail->Host = $Host; $mail->Username = $Username; $mail->Password = $Password; $mail->From = $From; $mail->FromName = $FromName; $mail->ConfirmReadingTo = $correo_personal; $mail->Subject = $Subject; $mail->AltBody = 'Para poder ver este mensaje utilize un cliente de correo compatible con contenido HTML!'; $mail->AddAddress('[email protected]'); $mail->AddAddress($CORRALO); if(!$mail->Send()) { $ale = '
Error enviando e-mail
'.$mail->ErrorInfo.'
'; echo $ale; } else { $ale = '
e-mail enviado Correctamente!
Esta Configuracion es valida.
'; echo $ale; } }catch (phpmailerException $e) { echo $e->errorMessage(); }catch (Exception $e) { echo $e->getMessage(); } }else{ ?> Por favor escriba una direccion de correo valida para realizar la prueba de envio de e-mail
asiste@server$\ document.getElementById('CORRALO_SMTP').focus(); function validar(e) { tecla = (document.all) ? e.keyCode : e.which; if (tecla==13) enviar(); } function enviar(){ var VARGET = 'CORREO='; VARGET += '&SERVIDOR='; VARGET += '&USUARIO='; VARGET += '&PASSWORD='; VARGET += '&SEGURIDAD='; VARGET += '&PUERTO='; VARGET += '&AUTENTICACION='; VARGET += '&CORRALO='+document.getElementById('CORRALO_SMTP').value; FAjax('test_smtp.php','RECIBE_TEST_SMTP',VARGET,'post','loading3'); document.getElementById('CORRALO2').innerHTML = document.getElementById('CORRALO_SMTP').value; document.getElementById('CORRALO_SMTP').style.visibility = "hidden"; }