Skip to content

Instantly share code, notes, and snippets.

@sameg14
Created September 2, 2015 01:10
Show Gist options
  • Save sameg14/e0cfd37989b72e5bde99 to your computer and use it in GitHub Desktop.
Save sameg14/e0cfd37989b72e5bde99 to your computer and use it in GitHub Desktop.
<?php
require('vendor/autoload.php');
require('config.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.gmail.com";
$mail->SMTPDebug = false;
$mail->SMTPAuth = true;
$mail->Port = 465;
$mail->Username = GMAIL_USERNAME;
$mail->Password = GMAIL_PASSWORD;
$mail->SMTPSecure = true;
//From email address and name
$mail->From = "[email protected]";
$mail->FromName = "PHP Mail Test";
//To address and name
$mail->addAddress("[email protected]", "Samir");
//Address to which recipient will reply
$mail->addReplyTo("[email protected]", "Reply Samir");
//Send HTML or Plain Text email
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body = "
<h3 style=\"color:blue;\">CHICAGO</h3> — Law enforcement continued a massive manhunt on Tuesday north of the city, searching for three suspects in the shooting death of a veteran police officer as he patrolled a quiet suburban community.
<br/>
The killing marks the fourth incident in nine days across the USA where a law enforcement officer has been slain while going about his regular duties.
<br/>
The incident in the far north Chicago suburbs comes after a Harris County, Texas, sheriff's deputy was gunned down Friday as he fueled his patrol car. Police on Saturday arrested Shannon Miles, who they said shot 15 bullets into Deputy Darren Goforth, 47. Sheriff Ron Hickman described the killing as a 'cold-blooded assassination.'
<br/>
On Aug. 26, police officer Henry Nelson was gunned down in Sunset, La. Two days earlier, Senior Trooper Steven Vincent, of the Louisiana State Police, was shot in the head and then taunted after he stopped to provide aid to a man whose truck was stuck in a ditch. Police said a witness to the fatal shooting heard the suspect tell the trooper after he shot him, \"You're lucky, you are going to die soon.\"";
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent successfully";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment