Skip to content

Instantly share code, notes, and snippets.

@brycemcd
Created February 4, 2010 01:18
Show Gist options
  • Save brycemcd/294266 to your computer and use it in GitHub Desktop.
Save brycemcd/294266 to your computer and use it in GitHub Desktop.
require_once("/var/www/crond/class-phpmailer.php");
try{
$report_email = new PHPMailer();
//hook into the GMAIL SMTP server
$report_email->Host = "smtp.gmail.com";
$report_email->SMTPAuth = true;
$report_email->SMTPSecure = "tls";
$report_email->Port = 587;
$report_email->Username = "email@domain.com";
$report_email->Password = "supersecret";
$report_email->AddAddress('bryce@jv2.com');
$report_email->From = "support@jv2.com";
$report_email->FromName = "JV2 Support";
$report_email->Subject = '$39 Bundled Sales Report';
$report_email->Body = $csv_out;
$report_email->isHTML(false);
$report_email->AddAttachment($filename);
$report_email->Send();
echo ("Email Sent Successfully: Report Day" . date('m-j-Y') );
} catch(Exception $e) {
echo ("Email Failed: Report Day" . date("m-j-Y") ." Error: $e" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment