-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
49 lines (45 loc) · 1.98 KB
/
index.php
File metadata and controls
49 lines (45 loc) · 1.98 KB
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
<?php
error_reporting(1);
require_once 'mailer.php';
if (isset($_POST['send_mail'])) {
$mailSend = "";
$className = "";
$recipientName = trim($_POST['recipient_name']);
$recipientEmail = trim($_POST['email_id']);
$subject = trim($_POST['subject']);
$msgContent = trim($_POST['msg_content']);
$attachment = $_FILES['image'];
if (emailSending($recipientName, $recipientEmail, $subject, $msgContent, $attachment)) {
$mailSend = "Successfully sent email";
$className = "success";
} else {
$mailSend = "Could not sent email";
$className = "danger";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sending email</title>
<link rel="stylesheet" href="./bootstrap.min.css" />
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<div class="container">
<form class="form-signin" action="" method="post" enctype="multipart/form-data">
<h2 class="form-signin-heading">Sending email</h2>
<input type="text" id="inputName" class="form-control" name="recipient_name" placeholder="Name" required autofocus><br/>
<input type="email" id="inputEmail" class="form-control" name="email_id" placeholder="Email address" required ><br/>
<input type="text" id="inputSubject" class="form-control" name="subject" placeholder="Subject" required ><br/>
<input type="file" id="inputFile" class="form-control" name="image"><br/>
<textarea name="msg_content" id="msgContent"class="form-control" cols="30" rows="10" placeholder="Message content"></textarea>
<b class="text-<?php echo $className; ?>"><?php echo $mailSend; ?></b><br>
<button class="btn btn-lg btn-primary btn-block" type="submit" name="send_mail" id="sendMail">Send Mail</button>
</form>
</div>
</body>
</html>