-
Notifications
You must be signed in to change notification settings - Fork 0
/
mail.php
55 lines (48 loc) · 1.11 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_page();
include 'includes/overall/overall_header.php';
?>
<h1><a href="admin.php">Administration</a> - Email All Users</h1>
<?php
if (isset($_GET['success']) === true && empty($_GET['success']) === true) {
?>
<h2><p>Your email has been sent!</p></h2>
<?php
} else {
if (empty($_POST) === false) {
if (empty($_POST['subject']) === true) {
$errors[] = 'Please enter a subject.';
}
if (empty($_POST['body']) === true) {
$errors[] = 'Please enter a message.';
}
if (empty($errors) === false) {
echo output_errors($errors);
} else {
mail_users($_POST['subject'], $_POST['body']);
echo '<meta HTTP-EQUIV="REFRESH" content="0; url=mail.php?success">';
exit();
}
}
?>
<p>Note: Personal greeting and signature is ALREADY inserted!</p>
<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="Sent Email">
</li>
</ul>
</form>
<?php
}
include 'includes/overall/overall_footer.php'; ?>