-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset-password-mail.php
57 lines (42 loc) · 1.63 KB
/
reset-password-mail.php
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
52
53
54
55
56
57
<?php
########### CONFIG ###############
$recipient = $_POST['email'];
$_POST['message'] = 'To reset your password, please click the link below and follow the constructions!
Please note, that you use the same browser as the one you used to request.
https://yvonne-goetzeler.developerakademie.net/join-pm/html/reset_password.html';
$redirect = 'index.html';
########### CONFIG END ###########
########### Intruction ###########
#
# This script has been created to send an email to the $recipient
#
# 1) Upload this file to your FTP Server
# 2) Send a POST rewquest to this file, including
# [name] The name of the sender (Absender)
# [message] Message that should be send to you
#
##################################
###############################
#
# DON'T CHANGE ANYTHING FROM HERE!
#
# Ab hier nichts mehr ändern!
#
###############################
switch ($_SERVER['REQUEST_METHOD']) {
case ("OPTIONS"): //Allow preflighting to take place.
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Allow-Headers: content-type");
exit;
case ("POST"): //Send the email;
header("Access-Control-Allow-Origin: *");
$subject = "Contact From JOIN-PROJECT-GROUP-465";
$headers = "From: noreply@developerakademie.com";
mail($_POST['email'], $subject, $_POST['message'], $headers);
header("Location: " . $redirect);
break;
default: //Reject any non POST or OPTIONS requests.
header("Allow: POST", true, 405);
exit;
}