-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathcontact.php
50 lines (32 loc) · 894 Bytes
/
contact.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
<?php
/*
* Collect all Details from Angular HTTP Request.
*/
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$name = $request->name;
$phone = $request->phone;
$email = $request->email;
$message = $request->message;
/* Set e-mail recipient */
$myemail = "[email protected]";
$subject="Message From your Dashboard";
/* Let's prepare the message for the e-mail */
$message = "Hello Boss,
You got a message from your Dashboard Site...
Name: $name
Phone: $phone
E-mail: $email
Message: $message
Thank you,
Have a nice day Boss...
End of message
";
/* Send the message using mail() function */
mail($myemail, $subject, $message);
echo 'success';
//this will go back under "data" of angular call.
/*
* You can use $email and $pass for further work. Such as Database calls.
*/
?>