diff options
| author | root | 2015-10-26 19:31:08 +0100 |
|---|---|---|
| committer | root | 2015-10-26 19:31:08 +0100 |
| commit | dc904a00f00e38f5db2f867bfc1d99f2ebd13cc7 (patch) | |
| tree | 6f634dba624a63a1c9ebc0a6c3f143d7e65c138f /mail.php | |
| parent | 6eeea9a2a84936a37b74078c727c06351765adab (diff) | |
| parent | 067a3863fe3d801ae6384dd5a904b9ad408dd3cc (diff) | |
| download | jungegemeinde-dc904a00f00e38f5db2f867bfc1d99f2ebd13cc7.tar.gz | |
Merge branch 'testing' of git.iamfabulous.de:jungegemeinde into testing
Diffstat (limited to 'mail.php')
| -rw-r--r-- | mail.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mail.php b/mail.php new file mode 100644 index 0000000..ad0eb81 --- /dev/null +++ b/mail.php @@ -0,0 +1,36 @@ +<?php +require_once 'PHPMailer/PHPMailerAutoload.php'; + +function getInstance() { + $mail = new PHPMailer; + //Tell PHPMailer to use SMTP + $mail->isSMTP(); + ////Enable SMTP debugging + //// 0 = off (for production use) + //// 1 = client messages + //// 2 = client and server messages + $mail->SMTPDebug = 2; + ////Ask for HTML-friendly debug output + $mail->Debugoutput = 'html'; + ////Set the hostname of the mail server + $mail->Host = "mx.iamfabulous.de"; + ////Set the SMTP port number - likely to be 25, 465 or 587 + $mail->Port = 587; + ////Whether to use SMTP authentication + $mail->SMTPAuth = false; + ////Set who the message is to be sent from + $mail->setFrom('jungegemeinde@iamfabulous.de', 'JG Adlershof'); + ////Set an alternative reply-to address + $mail->addReplyTo('mail@iamfabulous.de', 'Maximilian Möhring'); + + return $mail; +} + +function sendMailWithHash($email, $name, $hash) { + $mail = getInstance(); + $mail->addAddress($email); + $mail->Subject = 'JG Login'; + $mail->msgHTML(file_get_contents('static/mail_template.php')); + + return $mail->sent(); +} |
