Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/10/2014, 02:38
json
 
Fecha de Ingreso: septiembre-2014
Mensajes: 180
Antigüedad: 9 años, 7 meses
Puntos: 14
Respuesta: No se muestra el cuerpo del mensaje phpmailer

Sí, en la misma página que te he puesto, si bajas para abajo tienes una sección que pone "A simple example". El ejemplo que ponen es:

Código PHP:
Ver original
  1. require 'PHPMailerAutoload.php';
  2.  
  3. $mail = new PHPMailer;
  4.  
  5. //$mail->SMTPDebug = 3;                               // Enable verbose debug output
  6.  
  7. $mail->isSMTP();                                      // Set mailer to use SMTP
  8. $mail->Host = 'smtp1.example.com;smtp2.example.com';  // Specify main and backup SMTP servers
  9. $mail->SMTPAuth = true;                               // Enable SMTP authentication
  10. $mail->Username = '[email protected]';                 // SMTP username
  11. $mail->Password = 'secret';                           // SMTP password
  12. $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
  13. $mail->Port = 587;                                    // TCP port to connect to
  14.  
  15. $mail->From = '[email protected]';
  16. $mail->FromName = 'Mailer';
  17. $mail->addAddress('[email protected]', 'Joe User');     // Add a recipient
  18. $mail->addAddress('[email protected]');               // Name is optional
  19. $mail->addReplyTo('[email protected]', 'Information');
  20. $mail->addCC('[email protected]');
  21. $mail->addBCC('[email protected]');
  22.  
  23. $mail->WordWrap = 50;                                 // Set word wrap to 50 characters
  24. $mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
  25. $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
  26. $mail->isHTML(true);                                  // Set email format to HTML
  27.  
  28. $mail->Subject = 'Here is the subject';
  29. $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
  30. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  31.  
  32. if(!$mail->send()) {
  33.     echo 'Message could not be sent.';
  34.     echo 'Mailer Error: ' . $mail->ErrorInfo;
  35. } else {
  36.     echo 'Message has been sent';
  37. }

Y ahí es donde he visto:

Código PHP:
Ver original
  1. $mail->isHTML(true);  // Set email format to HTML
  2.  
  3. $mail->Subject = 'Here is the subject';
  4. $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
__________________
Unelink.es - VPS, servidores dedicados, hosting y dominios. 10 años a tu lado.