Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. require 'PHPMailer-master/PHPMailerAutoload.php';
  2.  
  3. $mail = new PHPMailer;
  4.  
  5. $mail->SMTPDebug = 4;
  6. $mail->Host ="*****";
  7. $Mail->SMTPAuth = true; // enable SMTP authentication;
  8. $mail->Username = "*****";
  9. $mail->Password = "****";
  10. $mail->Port = 587;
  11. $mail->SMTPSecure = "tls";
  12. $mail->From = "******";
  13. $mail->FromName = "Jurgen Hof";
  14.  
  15. $mail->addAddress("testingaccount23@gmail.com", "Tester");
  16. $mail->isHTML(true);
  17.  
  18. $mail->Subject = 'Test Leave Application';
  19. $mail->Body = 'Test.';
  20. $mail->AddAttachment("/var/www/html/leaveform/AlpineLeaveApplication.pdf");
  21.  
  22. if(!$mail->Send()) {
  23. echo 'Message could not be sent.';
  24. echo 'Mailer Error: ' . $mail->ErrorInfo;
  25. exit;
  26. }
  27. echo 'Email Sent Successfully!';
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement