Guest User

Untitled

a guest
Mar 16th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. $para .= 'wez@example.com';
  2. $título = 'Recordatorio de cumpleaños para Agosto';
  3. $mensaje = 'Hola';
  4. $cabeceras = 'MIME-Version: 1.0' . "rn";
  5. $cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
  6.  
  7. $cabeceras .= 'To: Mary , Kelly ' . "rn";
  8. $cabeceras .= 'From: Recordatorio ' . "rn";
  9. $cabeceras .= 'Cc: birthdayarchive@example.com' . "rn";
  10. $cabeceras .= 'Bcc: birthdaycheck@example.com' . "rn";
  11. mail($para, $título, $mensaje, $cabeceras);
  12.  
  13. <?php
  14. //Load
  15. require_once('PHPMailer/PHPMailerAutoload.php');
  16.  
  17. $mail = new PHPMailer(true);
  18. $mail->SMTPOptions = array(
  19. 'ssl' => array(
  20. 'verify_peer' => false,
  21. 'verify_peer_name' => false,
  22. 'allow_self_signed' => true
  23. )
  24. );
  25. $mail->SMTPDebug = 2;
  26. $mail->IsSMTP();
  27. $mail->SMTPAuth = true;
  28. //$mail->SMTPSecure = "ssl";
  29. $mail->SMTPSecure = 'tls';
  30. $mail->Host = 'smtp.gmail.com';
  31. $mail->Port = 587;// TCP port to connect to
  32. $mail->CharSet = 'UTF-8';
  33. $mail->Username ='algien@gmail.com'; //tu gmail
  34. $mail->Password = '31542'; //tu password
  35. //Agregar destinatario
  36. $mail->setFrom('user@mail.com', 'Mary , Kelly');
  37. $mail->AddAddress('wez@example.com');//A quien mandar email
  38. $mail->SMTPKeepAlive = true;
  39. $mail->Mailer = "smtp";
  40.  
  41. //Content
  42. $mail->isHTML(true); // Set email format to HTML
  43. $mail->Subject = 'Recordatorio de cumpleaños para Agosto';
  44. $mail->Body = 'Hola</b>';
  45.  
  46.  
  47. if(!$mail->send()) {
  48. echo 'Error al enviar email';
  49. echo 'Mailer error: ' . $mail->ErrorInfo;
  50. } else {
  51. echo 'Mail enviado correctamente';
  52. }
Add Comment
Please, Sign In to add comment