-
Notifications
You must be signed in to change notification settings - Fork 0
/
send_mail.php
54 lines (40 loc) · 1.49 KB
/
send_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
<?php
########### CONFIG ###############
$recipient = '[email protected]';
$redirect = 'https://kev-wagner.com/checkout';
########### 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 " . $_POST['name'] . " " . $_POST['email'];
// $subject = "Contact From" "echo $_POST['name']." ".$_POST['email'];.";
$headers = "From: [email protected]";
mail($recipient, $subject, $_POST['message'], $headers);
header("Location: " . $redirect);
break;
default: //Reject any non POST or OPTIONS requests.
header("Allow: POST", true, 405);
exit;
}