Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/02/2013, 11:10
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Problema para enviar correo electronico utilizando phpMailer

Problema para enviar correo electronico utilizando phpMailer

este es mi codigo
Código PHP:
Ver original
  1. $mail = new PHPMailer();  
  2. $mail->IsHTML(true);  
  3. $mail->IsSMTP();  
  4. $mail->SMTPAuth = true; // enable SMTP authentication  
  5. $mail->SMTPSecure = "ssl"; // sets the prefix to the servier  
  6. $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server  
  7. $mail->Port = 465; // set the SMTP port for the GMAIL server  
  8. $mail->Username = "micuenta"; // GMAIL username  
  9. $mail->Password = "mipassword"; // GMAIL password  
  10. $mail->From = "[email protected]"; // "[email protected]";  
  11. //$mail->AddReplyTo = "[email protected]"; // Reply  
  12. $mail->FromName = "Mr.Weerachai Nukitram";  // set from Name  
  13. $mail->Subject = "Test sending mail.";  
  14. $mail->Body = "My Body & <b>My Description</b>";  
  15.  
  16. $mail->AddAddress("[email protected]", "Mr.Adisorn Boonsong"); // to Address  
  17.  
  18.  
  19. //$mail->AddCC("[email protected]", "Mr.Member ShotDev"); //CC  
  20. //$mail->AddBCC("[email protected]", "Mr.Member ShotDev"); //CC  
  21.  
  22. $mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low  
  23.  
  24. $mail->Send();

este es el error que estoy obteniendo
SMTP -> ERROR: Failed to connect to server: Connection refused (111)

que estoy haciendo mal?