1 |
<? |
2 |
|
3 |
function sendMail($to, $subject, $body, $from = '') { |
4 |
|
5 |
global $cfg_pre_boot; |
6 |
|
7 |
ini_set('SMTP', $cfg_pre_boot['smtp']['host']); |
8 |
//ini_set('sendmail_from', $cfg_pre_boot['smtp']['from']); |
9 |
|
10 |
$headers = ''; |
11 |
if ($from) { |
12 |
$headers = "From: $from"; |
13 |
} |
14 |
|
15 |
$retval = 0; |
16 |
if ($to) { |
17 |
print "\n"; |
18 |
print "===================================\n"; |
19 |
print "mail\n"; |
20 |
print "To: $to\n"; |
21 |
print "Subject: $subject\n"; |
22 |
print "Body: \n------\n$body\n------\n"; |
23 |
print "Headers: $headers\n"; |
24 |
print "===================================\n"; |
25 |
print "\n"; |
26 |
$retval = mail($to, $subject, $body, $headers); |
27 |
// $retval = mail($to, $subject, $body); |
28 |
} |
29 |
|
30 |
return $retval; |
31 |
|
32 |
} |
33 |
|
34 |
?> |