Foros del Web » Programando para Internet » PHP »

Mail con PHPMailer no funciona

Estas en el tema de Mail con PHPMailer no funciona en el foro de PHP en Foros del Web. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código PHP: Ver original <?php require_once ( 'class.phpmailer.php' ) ;   function SendMail ( $Smail , $NombreUsuario , $Ssub , $SMensa ) { ...
  #1 (permalink)  
Antiguo 13/06/2010, 11:51
Avatar de Master_raven  
Fecha de Ingreso: junio-2008
Ubicación: Guatemala City, Guatemala, Guatemala
Mensajes: 95
Antigüedad: 15 años, 10 meses
Puntos: 3
Mail con PHPMailer no funciona

Código PHP:
Ver original
  1. <?php
  2. require_once('class.phpmailer.php');
  3.  
  4. function SendMail($Smail, $NombreUsuario, $Ssub, $SMensa) {
  5.  
  6. try {
  7.     $mail = new PHPMailer(true); //New instance, with exceptions enabled
  8.  
  9.     $body             = $SMensa;
  10.  
  11.  
  12.     $mail->IsSMTP();                           // tell the class to use SMTP
  13.     $mail->SMTPAuth   = true;                  // enable SMTP authentication
  14.     $mail->Port       = 25;                    // set the SMTP server port
  15.     $mail->Host       = "mail.exclusivehosting.net"; // SMTP server
  16.     $mail->Username   = "[email protected]";    // SMTP server username
  17.     $mail->Password   = "password";            // SMTP server password
  18.  
  19.     $mail->IsSendmail();  // tell the class to use Sendmail
  20.  
  21.     $mail->AddReplyTo("[email protected]","QiuBox Guatemala");
  22.  
  23.     $mail->From       = "[email protected]";
  24.     $mail->FromName   = "QiuBox Guatemala";
  25.  
  26.     $to = $Smail;
  27.  
  28.     $mail->AddAddress($to);
  29.  
  30.     $mail->Subject  = $Ssub;
  31.  
  32.     $mail->AltBody    = "Para ver este mensaje, usar compativilidad con HTML, Gracias!"; // optional, comment out and test
  33.     $mail->WordWrap   = 80; // set word wrap
  34.  
  35.     $mail->MsgHTML($body);
  36.  
  37.     $mail->IsHTML(true); // send as HTML
  38.  
  39.     $mail->Send();
  40.     return $e = 'Message has been sent.';
  41. } catch (phpmailerException $e) {
  42.     return $e->errorMessage();
  43. }
  44. }
  45. ?>

ese es el codigo, y el problema es que cuando me lo mando a cuentas de mi server si llegan los correos pero cuando lo mando a gmail, hotmail o yahoo ya no llega nada, si me pudieran ayudar muy agradecido
  #2 (permalink)  
Antiguo 13/06/2010, 12:47
Avatar de wiwi74  
Fecha de Ingreso: marzo-2008
Mensajes: 515
Antigüedad: 16 años, 1 mes
Puntos: 10
Respuesta: Mail con PHPMailer no funciona

Quiza el problema este en lo que envias en el cuerpo del mensaje, ya que dices que funciona hacia otros emails.

Ejemplo: gmail me filtraba los emails cuando en el cuerpo (html) enviaba una url sin nombre (por ip).
  #3 (permalink)  
Antiguo 13/06/2010, 13:08
Avatar de Master_raven  
Fecha de Ingreso: junio-2008
Ubicación: Guatemala City, Guatemala, Guatemala
Mensajes: 95
Antigüedad: 15 años, 10 meses
Puntos: 3
Respuesta: Mail con PHPMailer no funciona

Funciona pero solo a los mail de mi hosting, cuando envio uno a hotmail, gmail o yahoo no funciona

el codigo HTML del mensaje lo genero asi

Código PHP:
Ver original
  1. function GenCodeHTMLRC($Cod, $User, $Name) {
  2. $CodeHTML = "
  3. <html>
  4. <head>
  5. <title>Activar Cuenta Qiubox Guatemala</title>
  6. <style>
  7. body {
  8.     background:#dedede;
  9.     margin:0px;
  10.     font: 80%/1.4  'Lucida Grande', Verdana, sans-serif;
  11. }
  12.  
  13. table {
  14. margin:10px;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <table width='490' border='0' cellspacing='2' cellpadding='2'>
  20.  <tr>
  21.    <td>Que tal ".$Name." Para recuperar tu contraseña as click en el siguiente enlace.</td>
  22.  </tr>
  23.  <tr>
  24.    <td><a href='http://kiubo.desonlinegt.com/?ref=Forgot&amp;cod=".$Cod."&amp;us=".$User."'>Click Aqui.!</a></td>
  25.  </tr>
  26. </table>
  27. </body>
  28. </html>";
  29. return $CodeHTML;
  30. }
  #4 (permalink)  
Antiguo 13/06/2010, 13:35
Avatar de santris  
Fecha de Ingreso: agosto-2009
Ubicación: Sant Feliu de Llobregat
Mensajes: 955
Antigüedad: 14 años, 8 meses
Puntos: 66
Respuesta: Mail con PHPMailer no funciona

Mira este aporte, quizás te resulte interesante:

http://www.forosdelweb.com/f18/metod...otmail-630896/
__________________
Tu álbum de cromos online!!
  #5 (permalink)  
Antiguo 13/06/2010, 14:04
Avatar de Master_raven  
Fecha de Ingreso: junio-2008
Ubicación: Guatemala City, Guatemala, Guatemala
Mensajes: 95
Antigüedad: 15 años, 10 meses
Puntos: 3
Respuesta: Mail con PHPMailer no funciona

de mil maravillas, me a funcionado exelente, santris y wiwi74 les estoy muy agradecido por su ayuda.!

Etiquetas: mail, phpmailer
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:20.