Ver Mensaje Individual
  #5 (permalink)  
Antiguo 10/12/2014, 12:28
Avatar de mdromed
mdromed
 
Fecha de Ingreso: septiembre-2009
Mensajes: 389
Antigüedad: 14 años, 7 meses
Puntos: 8
Respuesta: Vista previa emails HTML sin tags

Cita:
Iniciado por pateketrueke Ver Mensaje
¿Y estás configurando PHPMailer para que envié el correo como HTML o hay que adivinar el código que utilizas para decirte qué hacer?
El codigo html de una plantilla cualquiera que le paso a phpmailer...

Código HTML:
Ver original
  1.   <head>
  2.     <style>
  3.        css styles
  4.     </style>
  5.   </head>
  6.   <body>
  7.     my email body
  8.   </body>
  9. </html>


Y la funcion phpmailer...

Código PHP:
Ver original
  1. function fun_sendEmailHtmlPhpMailer ($arg_asunto,$arg_msjCuerpo,$arg_emailDe,$arg_nombreDe,$arg_emailPara,$arg_emailRespuesta,$arg_emailCc,$arg_emailBcc,$arg_user,$arg_password,$arg_numPrioridad = 3) {
  2.         require_once("classes/cla_phpMailer.php"); // Add the path of the class
  3.         $obj_mail = new PHPMailer();
  4.         $obj_mail->IsSMTP(); // Use SMTP
  5.         $obj_mail->Host = cte_mailHost; // Sets SMTP server
  6.         $obj_mail->SMTPDebug = 0; // 2 to enable SMTP debug information
  7.         $obj_mail->SMTPAuth = true; // enable SMTP authentication
  8.         $obj_mail->SMTPSecure = cte_mailHostTipoSeguridad; //Secure conection
  9.         $obj_mail->Port = cte_mailHostPort; // set the SMTP port
  10.         if($arg_user){$obj_mail->Username = $arg_user;} // SMTP account username
  11.         if($arg_password){$obj_mail->Password = $arg_password;} // SMTP account password
  12.         $obj_mail->Priority = $arg_numPrioridad; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
  13.         $obj_mail->CharSet = "UTF-8";
  14.         $obj_mail->Encoding = "8bit";
  15.         $obj_mail->Subject = $arg_asunto;
  16.         $obj_mail->ContentType = "text/html; charset=utf-8";
  17.         $obj_mail->From = $arg_emailDe;
  18.         if($arg_nombreDe){$obj_mail->FromName = $arg_nombreDe;}
  19.         $obj_mail->WordWrap = 900; // RFC 2822 Compliant for Max 998 characters per line
  20.         $obj_mail->AddAddress($arg_emailPara); // To:
  21.         if($arg_emailRespuesta){$obj_mail->AddReplyTo($arg_emailRespuesta);} // Reply:
  22.         if($arg_emailCc){$obj_mail->AddCC($arg_emailCc);} // Copia CC:
  23.         if($arg_emailBcc){$obj_mail->AddBCC($arg_emailBcc);} // Copia Oculta BCC:
  24.         $obj_mail->isHTML(true);
  25.         $obj_mail->Body = $arg_msjCuerpo; //El msj en HTML
  26.         $obj_mail->AltBody = $arg_msjCuerpo; //El msj pero en texto plano
  27.         $obj_mail->Send();
  28.         $obj_mail->SmtpClose();
  29.  
  30.         if($obj_mail->IsError()){return false;}
  31.         else{return true;}
  32.     }