-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmail.php
65 lines (49 loc) · 1.12 KB
/
mail.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
<?php
include'core/init.php';
protect_page();
admin_protect();
include'includes/overall/header.php';?>
<h1>Email all Users</h1>
<?php
if(isset($_GET['success'])===true&&empty($_GET['success'])===true){
?>
<p> 'E-Mail has been sent successfully.'</p>
<?php
}
else{
if(empty($_POST)===false){//if form is submitted
if(empty($_POST['subject'])=== true){
$errors[]='subject is required';
}
if(empty($_POST['body'])=== true){
$errors[]='Body is required';
}
if(empty($errors)===false){
echo output_errors($errors);
}
else{
mail_users($_POST['subject'],$_POST['body']);
header('Location:mail.php?success');
exit();
}
}
?>
<form action="" method="post">
<ul>
<li>
Subject*: <br>
<input type="text" name="subject" required="required">
</li>
<li>
Body*: <br>
<textarea name="body" required="required"></textarea>
</li>
<li>
<input type="submit" name="Send" >
</li>
</ul>
</form>
<?php
}
include 'includes/overall/footer.php';
?>