SHARE
TWEET

Untitled

a guest Oct 4th, 2017 387 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  //enviar email al administrador
  3. function enviarAdjunto($email, $nombreUsuario, $asunto, $cuerpo){
  4. require 'php/PHPMailer/PHPMailerAutoload.php';
  5.  
  6. $mail = new PHPMailer();
  7. $mail->isSMTP();
  8. $mail->SMTPDebug = 0; //mostrar los errores
  9. $mail->SMTPAuth = true;
  10. $mail->SMTPSecure = 'tls'; // Modificar
  11. $mail->Host = 'smtp.gmail.com'; // Modificar
  12. $mail->Port = 587; // Modificar
  13. $mail->Username = 'administrador@gmail.com'; // Modificar
  14. $mail->Password = 'Lalalalala_12656532'; // Modificar
  15.  
  16. $mail->setFrom('administrador@gmail.com'); // Modificar REMITENTE
  17. $mail->addAddress($email, $nombreUsuario); // DESTINATARIO
  18.  
  19. $mail->Subject = $asunto;
  20. $mail->Body    = $cuerpo;
  21. $mail->IsHTML(true);
  22.  
  23. //ENVIO DEL EMAIL ...
  24. if($mail->send() ) {
  25.     return true;
  26. }
  27. else {
  28.     return false;
  29. }
  30. }
  31. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top