66 lines
2.0 KiB
PHP
66 lines
2.0 KiB
PHP
<?php
|
|
|
|
include("../class/dB.class.php");
|
|
require_once("../../PHPMailer/src/PHPMailer.php");
|
|
require_once("../../PHPMailer/src/Exception.php");
|
|
require_once("../../PHPMailer/src/SMTP.php");
|
|
|
|
use PHPMailer\PHPMailer\PHPMailer;
|
|
use PHPMailer\PHPMailer\SMTP;
|
|
use PHPMailer\PHPMailer\Exception;
|
|
|
|
session_start();
|
|
if ( $_SESSION['auth'] != true )
|
|
{
|
|
$_SESSION['auth'] = false;
|
|
header("Location: ../login.php");
|
|
}
|
|
|
|
if(isset($_GET["uid"]))
|
|
{
|
|
$uid = $_GET["uid"];
|
|
}
|
|
else
|
|
{
|
|
header('Location: ../index.php');
|
|
}
|
|
|
|
$mydb= new DB_MySQL('zeltlager','zeltlager','Z3ltlager3363','localhost');
|
|
|
|
$sql = "UPDATE `zeltlager`.`AnmeldungStatus` SET `bestaetigt` = '1' WHERE `AnmeldungStatus`.`uid` = '$uid'";
|
|
$mydb->query($sql);
|
|
|
|
$mail = new PHPMailer();
|
|
$mail->IsSMTP(); // send via SMTP
|
|
$mail->Host = "mail.fischerkoenig.de"; // SMTP servers
|
|
$mail->Port = "587";
|
|
$mail->SMTPAuth = true; // turn on SMTP authentication
|
|
$mail->Username = "mail@zeltlageranmeldung.de"; // SMTP username
|
|
$mail->Password = "Z3ltlagerMail!"; // SMTP password
|
|
|
|
$mail->From = "mail@zeltlageranmeldung.de";
|
|
$mail->FromName = "Evang. Gemeindejugend Memmingen";
|
|
|
|
//Empfängeradresse setzen
|
|
$mydb->query("SELECT * FROM AnmeldungAdressen WHERE uid='$uid'");
|
|
$row = $mydb->fetchRow();
|
|
$mail->AddAddress($row['email']);
|
|
|
|
//Betreff der Email setzen
|
|
$mail->Subject = "Zeltlageranmeldung Evang. Gemeindejugend Memmingen";
|
|
|
|
//Text der EMail setzen
|
|
$mailtext ="Hallo Lagerteilnehmer!\n\nDie Zeltlageranmeldung (Teilnehmer/in: ". ($row['vorname']) .") wurde im System bestätigt.\nDer nächste Schritt ist das Abbuchen des Lagerbeitrags Mitte Juli.\n\nViele Grüße,\nDie Zeltlageranmeldung";
|
|
$mail->Body = utf8_decode($mailtext);
|
|
|
|
$mail->IsHTML(false);
|
|
$mail->Send();
|
|
|
|
$mail->ClearAddresses();
|
|
|
|
|
|
$mydb->disconnect();
|
|
|
|
header('Location: ../index.php?pageId=1');
|
|
|
|
?>
|