Update version.php to 3.3.0
[isso.git] / Mail.php
index 05db039077975251ec66f9ebaa48b8943c9178b8..aceb47437561f0d01682b8a2fba878a7a6b82c83 100644 (file)
--- a/Mail.php
+++ b/Mail.php
@@ -2,7 +2,7 @@
 /*=====================================================================*\
 || ###################################################################
 || # Blue Static ISSO Framework
-|| # Copyright (c)2005-2008 Blue Static
+|| # Copyright (c)2005-2009 Blue Static
 || #
 || # This program is free software; you can redistribute it and/or modify
 || # it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ require_once(ISSO . '/Functions.php');
  * sends mail with full email headers.
  *
  * @author             Blue Static
- * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @copyright  Copyright (c)2005 - 2009, Blue Static
  * @package            ISSO
  * 
  */
@@ -181,7 +181,7 @@ class BSMail
         *
         * @return      bool    Status of the message
         */
-       public function send($address, $name = null, $sendHtml = false)
+       public function send($address, $name = null, $sendhtml = false)
        {
                if (empty($address))
                {
@@ -192,7 +192,7 @@ class BSMail
                // TODO - add support for SMTP
                if (!@ini_get('sendmail_path'))
                {
-                       BSApp::debug("email: no sendmail -> not sending");
+                       BSApp::debug("BSMail: no sendmail -> not sending");
                        return false;
                }
                
@@ -242,7 +242,8 @@ class BSMail
                // see if we need to use mime/multipart
                if ($sendhtml && !empty($bodyhtml) == true)
                {
-                       $boundary = 'ISSO-MULTIPART-' . BSFunctions::Rand(10);
+                       require_once ISSO . '/Functions.php';
+                       $boundary = 'ISSO-MULTIPART-' . BSFunctions::random(10);
                        $headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\"" . $this->delim;
                        
                        $bodyHtml = BSFunctions::convert_line_breaks($this->bodyHtml, $this->delim);
@@ -276,11 +277,11 @@ class BSMail
                // attempt to send the mail!
                if (mail($tostring, $subject, $body, $headers, "-f {$from}"))
                {
-                       BSApp::debug("email: sent to $address");
+                       BSApp::debug("BSMail: sent to $address");
                }
                else
                {
-                       BSApp::debug("email: error sending to $address");
+                       BSApp::debug("BSMail: error sending to $address");
                }
        }