aboutsummaryrefslogtreecommitdiff
path: root/mail.php
blob: e8294bd380696267bb1fb28fcc00986a0aebc619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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 = 0;
	////Ask for HTML-friendly debug output
	$mail->Debugoutput = 'html';
	////Set the hostname of the mail server
	$mail->Host = "mx.iamfabulous.de";
	$mail->SMTPSecure = 'tls';
	////Set the SMTP port number - likely to be 25, 465 or 587
	$mail->Port = 25;
	////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';

	ob_start();
	include('static/mail_template.php');
	$content = ob_get_clean();

	$mail->msgHTML( $content );
/*
'Hallo ' . htmlentities($name) . ', <br>
<br>
um dich auf der Website der JG einzuloggen bitte folge <a href="https://jungegemeinde.iamfabulous.de/?page=action&task=verify&email=' . htmlentities($email) . '&hash=' . $hash . '&goto='.htmlentities($_GET['goto']) . '" title="Einloggen">diesen Link</a>.
<br>
Viele Gr' . htmlentities(üß) . 'e, <br>
<br>
JG Adlershof ');
 */

	return $mail->send();
}