Last active
December 21, 2015 02:49
-
-
Save LinuxPhreak/6237657 to your computer and use it in GitHub Desktop.
SMS Sender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once '../class.phpmailer.php'; | |
$results_messages = array(); | |
$mail = new PHPMailer(true); | |
$mail->CharSet = 'utf-8'; | |
$mail->IsSMTP(); | |
$mail->SMTPDebug = 0; | |
$mail->Host = "smtp.gmail.com"; | |
$mail->Port = "587"; | |
$mail->SMTPSecure = "ssl"; | |
$mail->SMTPAuth = true; | |
$mail->Username = "someemail@gmail.com"; | |
$mail->Password = "mypassword"; | |
$mail->AddReplyTo("my@gmail.com", "Ben"); | |
$mail->From = "my@gmail.com"; | |
$mail->FromName = "Ben"; | |
$mail->AddAddress($number . $gateway, "Customer"); | |
$mail->Subject = "Hello"; | |
$body = <<<'EOT' | |
Hello | |
EOT; | |
$mail->WordWrap = 80; | |
$mail->MsgHTML($body, dirname(__FILE__), true); //Create message bodies and embed images | |
$mail->AddAttachment('images/phpmailer_mini.gif', 'phpmailer_mini.gif'); // optional name | |
$mail->AddAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name | |
} | |
catch (phpmailerAppException $e) { | |
$results_messages[] = $e->errorMessage(); | |
} | |
if (count($results_messages) > 0) { | |
echo "<h2>Run results</h2>\n"; | |
echo "<ul>\n"; | |
foreach ($results_messages as $result) { | |
echo "<li>$result</li>\n"; | |
} | |
echo "</ul>\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment