Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2. include "class.phpmailer.php";
  3. include "class.smtp.php";
  4.  
  5. $email_user = "TU_EMAIL";
  6. $email_password = "TU_PASSWORD";
  7. $the_subject = "Phpmailer prueba by Evilnapsis.com";
  8. $address_to = "evilnapsis@gmail.com";
  9. $from_name = "Evilnapsis";
  10. $phpmailer = new PHPMailer();
  11.  
  12. // ---------- datos de la cuenta de Gmail -------------------------------
  13. $phpmailer->Username = $email_user;
  14. $phpmailer->Password = $email_password;
  15. //-----------------------------------------------------------------------
  16. // $phpmailer->SMTPDebug = 1;
  17. $phpmailer->SMTPSecure = 'ssl';
  18. $phpmailer->Host = "smtp.gmail.com"; // GMail
  19. $phpmailer->Port = 465;
  20. $phpmailer->IsSMTP(); // use SMTP
  21. $phpmailer->SMTPAuth = true;
  22.  
  23. $phpmailer->setFrom($phpmailer->Username,$from_name);
  24. $phpmailer->AddAddress($address_to); // recipients email
  25.  
  26. $phpmailer->Subject = $the_subject;
  27. $phpmailer->Body .="<h1 style='color:#3498db;'>Hola Mundo!</h1>";
  28. $phpmailer->Body .= "<p>Mensaje personalizado</p>";
  29. $phpmailer->Body .= "<p>Fecha y Hora: ".date("d-m-Y h:i:s")."</p>";
  30. $phpmailer->IsHTML(true);
  31.  
  32. $phpmailer->Send();
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement