Skip to content

Commit 9246ee8

Browse files
committed
not working
1 parent a660a23 commit 9246ee8

File tree

2 files changed

+123
-1
lines changed

2 files changed

+123
-1
lines changed

Send Mail/index.html

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,77 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Send Mail</title>
77
<link rel="stylesheet" href="" />
8+
<link
9+
rel="stylesheet"
10+
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
11+
/>
812
</head>
9-
<body></body>
13+
<body>
14+
<div class="container">
15+
<div class="row">
16+
<div class="col-md-4 offset-md-4 mail-form">
17+
<h2 class="text-center">Send Message</h2>
18+
<p class="text-center">Send mail to anyone from LocalHost</p>
19+
<?php
20+
21+
$recipient = "";
22+
23+
if(isset($_POST['send'])){
24+
$recipient = $_POST['email'];
25+
$subject = $_POST['subject'];
26+
$message = $_POST['message'];
27+
$sender = "From: [email protected]";
28+
if(empty($recipient) || empty($subject) || empty($message)){
29+
?>
30+
31+
<div class="alert alert-danger text-center">
32+
<?php echo 'All inputs are required' ?>
33+
</div>
34+
<?php }else{
35+
if(mail($recipient, $subject, $message, $sender))
36+
} ?>
37+
38+
<div class="alert alert-danger text-center">
39+
<?php echo "Failed while sending your mail!" ?>
40+
</div>
41+
<?php
42+
}
43+
}
44+
}
45+
?>
46+
<form action="mail.php" method="POST">
47+
<div class="form-group">
48+
<input
49+
class="form-control"
50+
name="email"
51+
type="email"
52+
placeholder="Recipients"
53+
value="<?php echo $recipient ?>"
54+
/>
55+
</div>
56+
<div class="form-group">
57+
<input
58+
class="form-control"
59+
name="subject"
60+
type="text"
61+
placeholder="Subject"
62+
/>
63+
</div>
64+
<div class="form-group">
65+
<!-- -->
66+
</div>
67+
<div class="form-group">
68+
<input
69+
class="form-control button btn-primary"
70+
type="submit"
71+
name="send"
72+
value="Send"
73+
placeholder="Subject"
74+
/>
75+
</div>
76+
</form>
77+
</div>
78+
</div>
79+
</div>
80+
</body>
1081
</html>

Send Mail/style.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* custom css styling */
2+
@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
3+
4+
html,
5+
body {
6+
background: #007bff;
7+
}
8+
9+
::selection {
10+
color: #fff;
11+
background: #007bff;
12+
}
13+
14+
.container {
15+
position: absolute;
16+
top: 50%;
17+
left: 50%;
18+
transform: translate(-50%, -50%);
19+
font-family: 'Poppins', sans-serif;
20+
}
21+
22+
.container .mail-form {
23+
background: #fff;
24+
padding: 25px 35px;
25+
border-radius: 5px;
26+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
27+
0 6px 20px 0 rgba(0, 0, 0, 0.19);
28+
}
29+
30+
.container form .form-control {
31+
height: 43px;
32+
font-size: 15px;
33+
}
34+
35+
.container .mail-form form .form-group .button {
36+
font-size: 17px !important;
37+
}
38+
39+
.container form .textarea {
40+
height: 100px;
41+
resize: none;
42+
}
43+
44+
.container .mail-form h2 {
45+
font-size: 30px;
46+
font-weight: 600;
47+
}
48+
49+
.container .mail-form p {
50+
font-size: 14px;
51+
}

0 commit comments

Comments
 (0)