Guest User

Untitled

a guest
Jan 8th, 2018
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2. require ('../../class/class.phpmailer.php');
  3. require '../../class/class.smtp.php';
  4.  
  5. $mail = new PHPMailer();
  6.  
  7. $mail->IsSMTP();
  8. $mail->SMTPSecure = 'ssl';
  9. $mail->Host = 'smtp.gmail.com';
  10. $mail->Port = 465;
  11. $mail->Username = 'test@gmail.com';
  12. $mail->Password = '**********';
  13. $mail->SMTPKeepAlive = true;
  14. $mail->Mailer = "smtp";
  15.  
  16. $mail->SMTPAuth = true;
  17. $mail->CharSet = 'utf-8';
  18.  
  19. $mail->setFrom('test@gmail.com', 'Test');
  20. $mail->addAddress('testok@gmail.com', 'Mensaje de Prueba');
  21. $mail->Subject = 'Mensaje';
  22. $mail->Body = 'Cuerpo';
  23. $test =$mail->Send();
  24. if($test) {
  25. echo 'Enviado.';
  26. echo 'Mailer error: ' . $mail->ErrorInfo;
  27. } else {
  28. echo 'Error.';
  29. }
  30.  
  31. ?>
Add Comment
Please, Sign In to add comment