-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail.php
executable file
·135 lines (110 loc) · 4.34 KB
/
email.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
$msg_from = $_GET['msg_from'];
$name = mysql_real_escape_string($_GET['name']);
if(strpos($name,'cei')!== FALSE){
echo "fail";
//die;
}
else
{
if($msg_from == "contact")
{
$phone = mysql_real_escape_string($_GET['phone']);
$email = mysql_real_escape_string($_GET['email']);
$msg = mysql_real_escape_string($_GET['message']);
$e_subject = "KnowRoaming Enquiry Recieved";
$e_message = "
<html>
<table border=\"0\" cellpadding=\"0\" width=\"700\" cellspacing=\"0\">
<tr><td colspan=\"3\" >
<font size=\"+1\" color=\"#1d4961\"><Strong>Enquiry Recieved</Strong></font>
</td></tr>
<tr>
<td colspan=\"3\" > </td>
</tr>
<tr>
<td colspan=\"3\" > </td>
</tr>
<tr><td colspan=\"3\" width=\"150\" ><strong>You Have Recieved an Enquiry,</strong></td></tr>
<tr><td></td><td></td><td> </td></tr>
<tr><td width=\"150\" ><strong>Name</strong></td><td >:</td><td > $name</td></tr>
<tr><td><strong>Phone</strong></td><td>:</td><td> $phone</td></tr>
<tr><td><strong>Email</strong></td><td>:</td><td> $email</td></tr>
<tr><td><strong>Message</strong></td><td>:</td><td> $msg</td></tr>
<tr><td></td><td></td><td> </td></tr>
<tr><td></td><td></td><td> </td></tr>
</table>
</html>";
//Write action to txt log
$log = "Submission: Contact Us".' - '.date("F j, Y, g:i a").PHP_EOL.
"User: ".$name.PHP_EOL.
"Email: ".$email.PHP_EOL.
"Phone: ".$phone.PHP_EOL.
"-------------------------".PHP_EOL;
//
file_put_contents('contact.txt', $log, FILE_APPEND);
}
else
{
$phone = mysql_real_escape_string($_GET['phone']);
$email = mysql_real_escape_string($_GET['email']);
$address = mysql_real_escape_string($_GET['address']);
$country = mysql_real_escape_string($_GET['country']);
$model = mysql_real_escape_string($_GET['model']);
$e_subject = "KnowRoaming Application Recieved";
$e_message = "
<html>
<table border=\"0\" cellpadding=\"0\" width=\"700\" cellspacing=\"0\">
<tr><td colspan=\"3\" >
<font size=\"+1\" color=\"#1d4961\"><Strong>Application Recieved</Strong></font>
</td></tr>
<tr>
<td colspan=\"3\" > </td>
</tr>
<tr>
<td colspan=\"3\" > </td>
</tr>
<tr><td colspan=\"3\" width=\"150\" ><strong>You Have Recieved an Application,</strong></td></tr>
<tr><td></td><td></td><td> </td></tr>
<tr><td width=\"150\" ><strong>Name</strong></td><td >:</td><td > $name</td></tr>
<tr><td><strong>Phone</strong></td><td>:</td><td> $phone</td></tr>
<tr><td><strong>Model</strong></td><td>:</td><td> $model</td></tr>
<tr><td><strong>Email</strong></td><td>:</td><td> $email</td></tr>
<tr><td><strong>Address</strong></td><td>:</td><td> $address</td></tr>
<tr><td><strong>Country</strong></td><td>:</td><td> $country</td></tr>
<tr><td></td><td></td><td> </td></tr>
<tr><td></td><td></td><td> </td></tr>
</table>
</html>";
//Write action to txt log
$log = "Submission: Apply Now".' - '.date("F j, Y, g:i a").PHP_EOL.
"User: ".$name.PHP_EOL.
"Email: ".$email.PHP_EOL.
"Phone: ".$phone.PHP_EOL.
"Phone Model: ".$model.PHP_EOL.
"Country: ".$country.PHP_EOL.
"Address: ".$address.PHP_EOL.
"Phone: ".$phone.PHP_EOL.
"-------------------------".PHP_EOL;
//
file_put_contents('applynow.txt', $log, FILE_APPEND);
}
$message = $e_message;
$to = "jobs@knowroaming.com";
$from = $email;
//$to = "ns1910@gmail.com";
$subject = $e_subject;
$headers = "MIME-Version: 1.0" ."\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From:$from <$from>"."\r\n";
$success = mail($to,$subject,$message,$headers);
if($success)
{
echo "success";
}
else
{
echo "fail";
}
}
?>