Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.61 KB | None | 0 0
  1. <?php
  2. require 'PhpMailer/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. echo 'Preparando Carga <br/>';
  7. $mail->SMTPDebug = 1;                               // Enable verbose debug output
  8. $mail->isSMTP();                                    // Set mailer to use SMTP
  9. $mail->Host = 'smtp.gmail.com';                     // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true;                             // Enable SMTP authentication
  11. $mail->SMTPSecure = 'ssl';                          // secure transfer enabled REQUIRED for GMail
  12. $mail->Username = 'asdasd@gmail.com';     // SMTP username
  13. $mail->Password = 'asdasd';           // SMTP password
  14. $mail->Port = 587;                                  // TCP port to connect to
  15.  
  16.  
  17. echo 'Datos de Correo<br/>';
  18. $mail->From = 'asdasd@gmail.com';
  19. $mail->FromName = 'Mailer';
  20. $mail->addAddress('asdasd@live.com', 'Joe User');     // Add a recipient
  21. $mail->addReplyTo('asdads@gmail.com', 'Information');
  22. //$mail->addBCC('bcc@example.com');
  23.  
  24. // Add attachments$mail->addAttachment('/var/tmp/file.tar.gz');        
  25. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg');     Optional name
  26. $mail->isHTML(true);                                  // Set email format to HTML
  27.  
  28. $mail->Subject = 'Contacto ';
  29. $mail->Body    = 'Hola! Tienes un nuevo mensaje de <b>XXXXX!</b>: <br/><p>MENSAJE</p> <br/> Su Correo es : CORREO  ';
  30. $mail->AltBody = '';
  31. echo 'Envio de Correo<br/>';
  32. echo (extension_loaded('openssl')?'SSL loaded':'SSL not loaded')."<br/>";
  33. if(!$mail->send()) {
  34.     echo 'Message could not be sent.';
  35.     echo 'Mailer Error: ' . $mail->ErrorInfo;
  36. } else {
  37.     echo 'Message has been sent';
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement