-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_mail.php
More file actions
76 lines (55 loc) · 2.18 KB
/
send_mail.php
File metadata and controls
76 lines (55 loc) · 2.18 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
########### CONFIG ###############
$recipient = 'your@mail.de';
#$redirect = 'reset_password.html';
########### CONFIG END ###########
#$timeStamp= round(microtime(true) * 1000);
#$to="sesgigi@yahoo.de";
#+$message="gruppe-348.developerakademie.net/join/reset_password.html";
#mail($to, $subject, $message, $headers);
#$somevar = $_GET["uid"]; //puts the uid varialbe into $somevar
########### 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: *");
$email = $_POST['email'];
$message = "Hello,\n
\nFollow this link to reset your Join password for your " . $email ." account.\n
\nhttps://join.simon-besenbaeck.developerakademie.net/reset_password.html?email=" . $email . "\n
\nIf you didn't ask to reset your password, you can ignore this email.\n
\nThanks,\n
\nYour Join team\n";
$recipient = $email;
$subject = "Reset your password for Join App";
$headers = "Form: noreply@https://simon-besenbaeck.com";
$result = mail($recipient, $subject, $message, $headers);
print($result);
#mail($recipient, $subject, $_POST['message'], $headers);
#header("Location: " . $redirect);
break;
default: //Reject any non POST or OPTIONS requests.
header("Allow: POST", true, 405);
exit;
}
$url="join.simon-besenbaeck.com/reset_password.html?email=".$_POST['email']."&timeSTamp=".$timeSTamp;