-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcontact.php
420 lines (362 loc) · 12.8 KB
/
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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$phn = $_POST['phn'];
$email = $_POST['email'];
$message = $_POST['message'];
$msgBody = '<!DOCTYPE html> <html> <head> <title>Contact us Form</title> </head> <body style="background-color: #ccc;"> <div class="row"> <div class="col-md-12"> Name: '.$name.'</div> </div> <div class="row"> <div class="col-md-12"> Phone no: '.$phn.'</div> </div> <div class="row"> <div class="col-md-12"> Email: '.$email.'</div> </div> <div class="row"> <div class="col-md-12"> Message: '.$message.'</div> </div> </body> </html>';
require "class.phpmailer.php";
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->SMTPDebug = 2;
$mail->Host = 'smtp.gmail.com'; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Password = 'aaranstone2'; // SMTP password suratrealestate admin@123*
$mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
$mail->Port = '465'; //Port Number
$mail->From = $email; //From Email Id
$mail->FromName = $name; //From Email Id Display Name Surat Real Esate(Real Estate)
//$mail->addAddress('[email protected]', 'Josh Adams'); // Add a recipient
$mail->addAddress('[email protected]','TMS'); // Name is optional
//$mail->addReplyTo('[email protected]', 'Information');
//$mail->addCC('[email protected]');
$mail->addBCC('[email protected]');
$mail->WordWrap = 50; // Set word wrap to 50 characters
//$mail->addAttachment(''); // Add attachments
//$mail->addAttachment('',''); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Contact us';
$mail->Body = $msgBody;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="author" content="Sahil Kumar">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Contact Us | TMS</title>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/sweetalert.min.js"></script>
<?php
if(isset($_POST['submit']) && $mail->send()){
//header("location:thanks.php");
echo'<script type="text/javascript" src="js/sweetalert.min.js"></script> <script type="text/javascript"> $(document).ready(function(){swal("Thanks", "We got your message.","success"); }); </script>';
}
/*else{
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}*/
?>
<style type="text/css" rel="stylesheet">
body {
margin: 0px;
padding: 0px;
}
#contact {
width: 100%;
height: 100vh;
background-color: #111;
overflow: hidden;
padding-bottom: 200px;
}
/* Begin Left Contact Page */
.form-horizontal {
float: left;
max-width: 400px;
font-family: 'Lato';
font-weight: 400;
}
.form-control, textarea {
max-width: 400px;
background-color: #fff;
color: #111;
letter-spacing: 1px;
}
.send-button {
margin-top: 15px;
height: 35px;
width: 445px;
overflow: hidden;
transition: all .2s ease-in-out;
}
.button {
width: 400px;
height: 34px;
transition: all .2s ease-in-out;
}
.send-text {
display: block;
margin-top: 10px;
font: 300 14px 'Lato', sans-serif;
letter-spacing: 2px;
}
.button:hover {
transform: translate3d(0px, -29px, 0px);
}
/* Begin Right Contact Page */
.direct-contact-container {
font-size: 14px;
max-width: 400px;
float: left;
margin-top: 70px;
margin-left: 150px;
}
/* Location, Phone, Email Section */
.contact-list {
margin-top: 20px;
list-style-type: none;
margin-left: -30px;
padding-right: 20px;
}
.list-item {
line-height: 75px;
color: #aaa;
}
.contact-text {
font: 300 18px 'Lato', sans-serif;
letter-spacing: 1.9px;
color: #bbb;
}
.place {
margin-left: 62px;
}
.phone {
margin-left: 56px;
}
.gmail {
margin-left: 53px;
}
.contact-text a {
color: #bbb;
text-decoration: none;
transition-duration: 0.2s;
}
.contact-text a:hover {
color: #000;
text-decoration: none;
}
hr {
border-color: rgba(255,255,255,.8); ;
}
/* Begin Media Queries*/
@media screen and (max-width: 760px)
{
#contact {
height: 1000px;
}
.section-header {
font-size: 65px;
}
.direct-contact-container, .form-horizontal {
float: none;
margin: 10px auto;
}
.direct-contact-container {
margin-top: 60px;
max-width: 300px;
}
.direct-contact-container .fa{
font-size: 20px;
}
}
/* Social Media Icons */
.social-media-list {
position: relative;
font-size: 2.3rem;
text-align: center;
width: 100%;
}
.social-media-list li a {
color: #fff;
}
.social-media-list li {
position: relative;
top: 0;
left: -20px;
display: inline-block;
height: 70px;
width: 70px;
margin: 10px auto;
line-height: 70px;
border-radius: 50%;
color: #fff;
background-color: rgb(27,27,27);
cursor: pointer;
transition: all .2s ease-in-out;
}
.social-media-list li:after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 70px;
height: 70px;
line-height: 70px;
border-radius: 50%;
opacity: 0;
box-shadow: 0 0 0 1px #fff;
transition: all .2s ease-in-out;
}
.social-media-list li:hover {
background-color: #fff;
}
.social-media-list li:hover:after {
opacity: 1;
transform: scale(1.12);
transition-timing-function: cubic-bezier(0.37,0.74,0.15,1.65);
}
.social-media-list li:hover a {
color: #111;
}
@media screen and (max-width: 569px)
{
#contact {
height: 1200px;
}
.section-header{
font-size: 50px;
}
.direct-contact-container, .form-wrapper {
float: none;
margin: 0 auto;
}
.form-control, textarea {
max-width: 340px;
margin: 0 auto;
}
.name, .email, textarea {
width: 280px;
}
.direct-contact-container {
margin-top: 60px;
max-width: 280px;
}
}
@media screen and (max-width: 410px)
{
.send-button
{
width: 99%;
}
}
.input-group-text{
padding-top: 20px;
width: 42px;
}
#basic-addons4{
padding-top: 20px;
}
.container{ margin-top:80px;
margin-bottom: 100px; }
</style>
</head>
<body>
<header>
<?php
include'navbar.php';
?>
</header>
<div class="container">
<div class="row">
<div class="col-md-6 mt-5 bg-default">
<h1 class="text-center text-dark">Contact Us</h1>
<hr class="bg-light">
<h5 class="text-center text-success"></h5>
<form class="form-horizontal" action="#" method="POST" id="form-box" class="p-2" style="padding-left: 50px;">
<div class="form-group input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text fa fa-user-circle" id="basic-addon1"></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Name" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="form-group input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text fa fa-mobile" id="basic-addon2"></span>
</div>
<input type="text" class="form-control" name="phn" placeholder="Phone No." aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<div class="form-group input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text fa fa-envelope" id="basic-addon3"></span>
</div>
<input type="text" class="form-control" name="email" placeholder="Email-Id" aria-label="Recipient's username" aria-describedby="basic-addon2">
</div>
<div class="form-group input-group">
<div class="input-group-prepend">
<span class="input-group-text fa fa-comment" id="basic-addons4" style="padding-top: 25px;"></span>
</div>
<textarea class="form-control" name="message" placeholder="Write your message" aria-label="With textarea"></textarea>
</div>
<button class="btn btn-info send-button" id="submit" name="submit" type="submit" value="SEND">
<div class="button">
<i class="fa fa-paper-plane"></i><span class="send-text">SEND</span>
</div>
</button>
</form>
</div>
<div class="col-md-6 mt-5 bg-default">
<div class="direct-contact-container">
<ul class="contact-list">
<li class="list-item">
<i class="fa fa-map-marker fa-2x">
<span class="contact-text place">
<a href="" title="Our Location">Surat | Gujarat</a>
</span>
</i>
</li>
<li class="list-item">
<i class="fa fa-phone fa-2x">
<span class="contact-text phone">
<a href="tel:1-91-704-305-6077" title="Give me a call">((+91) 704-305-6077)</a>
</span>
</i>
</li>
<li class="list-item">
<i class="fa fa-envelope fa-2x">
<span class="contact-text gmail">
<a href="mailto:#" title="Send me an email">[email protected]
</a>
</span>
</i>
</li>
</ul>
<hr class="bg-dark">
<ul class="social-media-list">
<li class="bg-info">
<a href="#" target="_blank" class="contact-icon">
<i class="fab fa-facebook-f" aria-hidden="true"></i>
</a>
</li>
<li class="bg-info">
<a href="#" target="_blank" class="contact-icon">
<i class="fab fa-twitter" aria-hidden="true"></i>
</a>
</li>
<li class="bg-info">
<a href="#" target="_blank" class="contact-icon">
<i class="fab fa-instagram" aria-hidden="true"></i>
</a>
</li>
<li class="bg-info">
<a href="#" target="_blank" class="contact-icon">
<i class="fab fa-google-plus-g" aria-hidden="true"></i>
</a>
</li>
</ul>
<hr>
</div>
</div>
</div>
</div>
<!-- FOOTER -->
<?php
include'footer.php';
?>
</body>
</html>