-
Notifications
You must be signed in to change notification settings - Fork 1
/
contact.php
240 lines (212 loc) · 7.81 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
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Sparks Bank| Home</title>
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link href='css/sty.css' rel='stylesheet' type='text/css'>
<style>
body {
background-color: #444442;
padding-top: 85px;
}
h1 {
font-family: 'Poppins', sans-serif, 'arial';
font-weight: 600;
font-size: 72px;
color: white;
text-align: center;
}
h4 {
font-family: 'Roboto', sans-serif, 'arial';
font-weight: 400;
font-size: 20px;
color: #9b9b9b;
line-height: 1.5;
}
/* ///// inputs /////*/
input:focus ~ label, textarea:focus ~ label, input:valid ~ label, textarea:valid ~ label {
font-size: 0.75em;
color: #999;
top: -5px;
-webkit-transition: all 0.225s ease;
transition: all 0.225s ease;
}
.styled-input {
float: left;
width: 250px;
margin: 1rem 0;
position: relative;
border-radius: 4px;
}
@media only screen and (max-width: 768px){
.styled-input {
width:100%;
}
}
.styled-input label {
color: #999;
padding: 1.3rem 30px 1rem 30px;
position: absolute;
top: 10px;
left: 0;
-webkit-transition: all 0.25s ease;
transition: all 0.25s ease;
pointer-events: none;
}
.styled-input.wide {
width: 650px;
max-width: 100%;
}
input,
textarea {
padding: 30px;
border: 0;
width: 100%;
font-size: 1rem;
background-color: #2d2d2d;
color: white;
border-radius: 4px;
}
input:focus,
textarea:focus { outline: 0; }
input:focus ~ span,
textarea:focus ~ span {
width: 100%;
-webkit-transition: all 0.075s ease;
transition: all 0.075s ease;
}
textarea {
width: 100%;
min-height: 10em;
}
.input-container {
width: 650px;
max-width: 100%;
margin: 20px auto 25px auto;
}
.submit-btn {
float: right;
padding: 7px 35px;
border-radius: 60px;
display: inline-block;
background-color: #4b8cfb;
color: white;
font-size: 18px;
cursor: pointer;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.06),
0 2px 10px 0 rgba(0,0,0,0.07);
-webkit-transition: all 300ms ease;
transition: all 300ms ease;
}
.submit-btn:hover {
transform: translateY(1px);
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.10),
0 1px 1px 0 rgba(0,0,0,0.09);
}
@media (max-width: 768px) {
.submit-btn {
width:100%;
float: none;
text-align:center;
}
}
input[type=checkbox] + label {
color: #ccc;
font-style: italic;
}
input[type=checkbox]:checked + label {
color: #f00;
font-style: normal;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="index.html">Sparks Bank</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-bars"><img src="img/img.png" style="height:30px; width:30px;"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav text-uppercase ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="contact.php">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<h2 class="text-center pt-4" style="color:white;">Contact Us</h2>
<form role="form" class="contact-form" action="contact.php?sendmail" method="post" enctype="multipart/form-data">
<div class="row input-container">
<div class="col-xs-12">
<div class="styled-input wide">
<input type="text" name="name" id="form_name" required />
<label>Name</label>
</div>
</div>
<div class="col-xs-12">
<div class="styled-input wide">
<input type="text" name="email" id="form_email" required />
<label>Email</label>
</div>
</div>
<div class="col-xs-12">
<div class="styled-input wide">
<textarea name="message" id="form_message" required></textarea>
<label>Message</label>
</div>
</div>
<div class="col-xs-12">
<input type="submit" value="Send Message" name="sendmail" id="sendMessageButton" class="btn btn-primary">
</div>
</div>
</form>
</div>
<?php
if(isset($_POST['sendmail'])) {
require 'PHPMailerAutoload.php';
$mail = new PHPMailer;
// $mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = "aasthaenterprise27@gmail.com"; // SMTP username
$mail->Password = "manoj2194"; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->setFrom('Website-User');
$mail->addAddress('shahaastha8@gmail.com'); // Add a recipient
$mail->addReplyTo($_POST['email']);
// print_r($_FILES['file']); exit;
//for ($i=0; $i < count($_FILES['file']['tmp_name']) ; $i++) {
//$mail->addAttachment($_FILES['file']['tmp_name'][$i], $_FILES['file']['name'][$i]); // Optional name
//}
$mail->isHTML(true); // Set email format to HTML
//$mail->Subject = $_POST['subject'];
$mail->Name = $_POST['name'];
$mail->Email = $_POST['email'];
$mail->Body = '<h3 align=left>Name: '.$_POST['name'].'<br><br>Email: '.$_POST['email'].'<br><br>Message: '.$_POST['message'].'</h3>' ;
if($mail->send()) {
echo "<script>alert('Thank You your message has been sent'); </script>";
echo "<script>window.location.href ='index.php'</script>";
}
else {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
}
?>
</body>
<!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</html>