-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend-email.php
More file actions
28 lines (23 loc) · 823 Bytes
/
send-email.php
File metadata and controls
28 lines (23 loc) · 823 Bytes
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
<?php
include 'include/connect.php';
include 'include/session.php';
if (isset($_POST['send-email'])) {
//$email_id = $email_id + 1;
$from = $_POST['sendfrom'];
$to = $_POST['sendto'];
$subject = $_POST['subject'];
if ($subject == '') {
$subject = "No subject";
}
$content = trim($_POST['content']);
$date = date("m/d/Y");
$time = date("h:i a");
$sqlsendemail="INSERT INTO `emails`( `sender_email`, `receiver_email`, `subject`, `content`, `date_sent`, `time_sent`,`status`)
VALUES ('$from','$to','$subject','$content','$date','$time','unread')";
if (mysqli_query($conn, $sqlsendemail)) {
?><script type="text/javascript">window.location="email-sent.php";</script><?php
} else {
echo "Error: " . $sqlsendemail . "<br>" . mysqli_error($conn);
}
}
?>