usermgmt improved (not yet finished)
[brisk.git] / web / Obj / mail.phh
diff --git a/web/Obj/mail.phh b/web/Obj/mail.phh
new file mode 100644 (file)
index 0000000..9f6bfbf
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+include_once 'Mail.php';
+include_once 'Mail/mime.php';
+
+$brisk_mail_hp = array( "text_charset"  => "utf-8",
+                        "html_charset" => "utf-8",
+                        "header_charset" => "utf-8",
+                        "eol" => "\n" );
+
+// references: <alfanum-8-chars>@<domain>
+function brisk_mail($to, $subject, $text, $html, $refs)
+{
+    GLOBAL $brisk_mail_hp, $G_admin_mail;
+
+    $hdrs = array(
+              'From'    => $G_admin_mail,
+              'Subject' => $subject,
+              'References' => $refs
+              );
+
+    $mime = new Mail_mime($brisk_mail_hp);
+
+    $mime->setTXTBody($text);
+    $mime->setHTMLBody($html);
+
+    $body = $mime->get();
+    $hdrs = $mime->headers($hdrs);
+
+    $mail = Mail::factory('mail');
+
+    $mail->send($to, $hdrs, $body);
+
+    return TRUE;
+}
+?>
\ No newline at end of file