forked from eestec/Lykeion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.php
executable file
·37 lines (34 loc) · 1.04 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
<?php
require_once 'database.php';
class mail{
public function _construct(){
}
public function SendMail($id,$table,$subject,$message){
$db=new database();
@$sql;
if($table=="users")
$sql="SELECT Email FROM ".$table." WHERE ID='$id'";
else
$sql="SELECT Login_email FROM ".$table." WHERE ID='$id'";
list($result,$a)=$db->query($sql);
@$mail="";
while(@$row=mysql_fetch_array($result)){
if($table=="users")
$mail=$row['Email'];
else
$mail=$row['Login_email'];
}
if($mail=="")
return false;
else{
$headers = "From: Lykeion <noreply@eestec.net>\r\n";
$headers .= "Reply-To: noreply@eestec.net\r\n";
$headers .= "Content-type: text/html\r\n";
mail($mail,$subject,$message,$headers);
if(mail){return true;}
else
return false;
}
}
}
?>