Guest User

Untitled

a guest
May 19th, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. require_once("/var/www/crond/class-phpmailer.php");
  2. try{
  3. $report_email = new PHPMailer();
  4. //hook into the GMAIL SMTP server
  5. $report_email->Host = "smtp.gmail.com";
  6. $report_email->SMTPAuth = true;
  7. $report_email->SMTPSecure = "tls";
  8. $report_email->Port = 587;
  9. $report_email->Username = "email@domain.com";
  10. $report_email->Password = "supersecret";
  11.  
  12. $report_email->AddAddress('bryce@jv2.com');
  13. $report_email->From = "support@jv2.com";
  14. $report_email->FromName = "JV2 Support";
  15. $report_email->Subject = '$39 Bundled Sales Report';
  16. $report_email->Body = $csv_out;
  17. $report_email->isHTML(false);
  18. $report_email->AddAttachment($filename);
  19. $report_email->Send();
  20. echo ("Email Sent Successfully: Report Day" . date('m-j-Y') );
  21. } catch(Exception $e) {
  22. echo ("Email Failed: Report Day" . date("m-j-Y") ." Error: $e" );
  23. }
Add Comment
Please, Sign In to add comment