-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.php
executable file
·55 lines (49 loc) · 1.06 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
<?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>Email has been sent</p>
<?php
} else {
if (empty($_POST) === false) {
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']);
echo "<script>window.top.location='mail.php?success'</script>";
header('Location: mail.php?success');
exit();
}
}
?>
<form action="" method="post">
<ul>
<li>
Subject*:<br>
<input type="text" name="subject">
</li>
<li>
Body*:<br>
<textarea name="body"></textarea>
</li>
<li>
<input type="submit" value="Send">
</li>
</ul>
</form>
<?php
}
include 'includes/overall/footer.php';
?>