9f6bfbfff5f0ac1d77b3f4323a904405ba837251
[brisk.git] / web / Obj / mail.phh
1 <?php
2 include_once 'Mail.php';
3 include_once 'Mail/mime.php';
4
5 $brisk_mail_hp = array( "text_charset"  => "utf-8",
6                         "html_charset" => "utf-8",
7                         "header_charset" => "utf-8",
8                         "eol" => "\n" );
9
10 // references: <alfanum-8-chars>@<domain>
11 function brisk_mail($to, $subject, $text, $html, $refs)
12 {
13     GLOBAL $brisk_mail_hp, $G_admin_mail;
14
15     $hdrs = array(
16               'From'    => $G_admin_mail,
17               'Subject' => $subject,
18               'References' => $refs
19               );
20
21     $mime = new Mail_mime($brisk_mail_hp);
22
23     $mime->setTXTBody($text);
24     $mime->setHTMLBody($html);
25
26     $body = $mime->get();
27     $hdrs = $mime->headers($hdrs);
28
29     $mail = Mail::factory('mail');
30
31     $mail->send($to, $hdrs, $body);
32
33     return TRUE;
34 }
35 ?>