me da este error
2014-02-17 15:47:30 SERVER -> CLIENT: 220 mx.google.com ESMTP 57sm48926640yhl.4 - gsmtp 2014-02-17 15:47:30 CLIENT -> SERVER: EHLO www.miweb.com.ar 2014-02-17 15:47:30 SERVER -> CLIENT: 250-mx.google.com at your service, [66.7.220.112] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN 250-ENHANCEDSTATUSCODES 250-PIPELINING 250 CHUNKING 2014-02-17 15:47:30 CLIENT -> SERVER: AUTH LOGIN 2014-02-17 15:47:30 SERVER -> CLIENT: 334 VXNlcm5hbWU6 2014-02-17 15:47:30 CLIENT -> SERVER: ZmVkZXJpY29tYXRpYXNiYWlzQGdtYWlsLmNvbQ== 2014-02-17 15:47:30 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2014-02-17 15:47:30 CLIENT -> SERVER: Y2FjaGltYm8xOTg3 2014-02-17 15:47:30 SERVER -> CLIENT: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at https://support.google.com/mail/bin/....py?answer=787 534 5.7.14 54 57sm48926640yhl.4 - gsmtp 2014-02-17 15:47:30 SMTP ERROR: Password command failed: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at https://support.google.com/mail/bin/....py?answer=787 534 5.7.14 54 57sm48926640yhl.4 - gsmtp 2014-02-17 15:47:30 CLIENT -> SERVER: QUIT 2014-02-17 15:47:31 SERVER -> CLIENT: 221 2.0.0 closing connection 57sm48926640yhl.4 - gsmtp SMTP connect() failed. Error: SMTP connect() failed.
este es el codigo que uso
Código PHP:
include("class.phpmailer.php");
include("class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "[email protected]";
$mail->Password = "mipass";
$mail->From = "[email protected]";
$mail->FromName = "Nombre";
$mail->Subject = "Asunto del Email";
$mail->AltBody = "Este es un mensaje de prueba.";
$mail->MsgHTML("<b>Este es un mensaje de prueba</b>.");
$mail->AddAddress("[email protected]", "[email protected]");
$mail->IsHTML(true);
if(!$mail->Send()) {
echo "Error: " . $mail->ErrorInfo;
} else {
echo "Mensaje enviado correctamente";
}