-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.php
More file actions
26 lines (24 loc) · 917 Bytes
/
mail.php
File metadata and controls
26 lines (24 loc) · 917 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
<?php
include 'Connection.php';
$query = "SELECT * FROM userdb ";
$result = $conn->query($query) or die($conn->error);
if($result){
if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_array($result)){
$to = $row['U_EMAIL'];
$subject = "Ldrp CE-IT Notify you...";
$txt = "Hey There is Official notification from college do checkout and download if you want to! ";
$headers = "From: ceit.ldrp@gmail.com" . "\r\n" .
"CC: ceit.ldrp@gmail.com";
mail($to,$subject,$txt,$headers);
}
echo "<script>alert('Mail done successfully')</script>";
echo '<script>window.location="AdminDataManager.php"</script>';
mysqli_free_result($result);
} else{
echo "No records matching your query were found.";
}
} else{
echo "ERROR: Could not able to execute $query. " . mysqli_error($conn);
}
?>