mosMailer Class Reference

Inheritance diagram for mosMailer:

aliroMailer

List of all members.

Public Member Functions

 __construct ($from='', $fromname='', $subject, $body)
 mosMail ($recipient, $mode=0, $cc=NULL, $bcc=NULL, $attachment=NULL, $replyto=NULL, $replytoname=NULL)

Private Attributes

 $body = ''


Detailed Description

Definition at line 40 of file aliroMailer.php.


Constructor & Destructor Documentation

mosMailer::__construct ( from = '',
fromname = '',
subject,
body 
)

Function to create a mail object for futher use (uses phpMailer)

Parameters:
string From e-mail address
string From name
string E-mail subject
string Message body
Returns:
object Mail object

Definition at line 51 of file aliroMailer.php.

References $body, aliroMailer::$config, and aliroCore::getInstance().

00051                                                                             {
00052         parent::__construct();
00053         $config = aliroCore::getInstance();
00054         $fromemail = $from ? $from : $config->getCfg('mailfrom');
00055         $fromname = $fromname ? $fromname : $config->getCfg('fromname');
00056         $from = "$fromname <$fromemail>";
00057         $this->setFrom ($from);
00058         $this->setSubject($subject);
00059         $this->body = $body;
00060 
00061     }


Member Function Documentation

mosMailer::mosMail ( recipient,
mode = 0,
cc = NULL,
bcc = NULL,
attachment = NULL,
replyto = NULL,
replytoname = NULL 
)

Mail function (uses htmlMimeMail5)

Parameters:
string From e-mail address
string From name
string/array Recipient e-mail address(es)
string E-mail subject
string Message body
boolean false = plain text, true = HTML
string/array CC e-mail address(es)
string/array BCC e-mail address(es)
string/array Attachment file name(s)
string/array Reply-to e-mail address
string/array Reply-to name

Definition at line 77 of file aliroMailer.php.

References aliroCoreDatabase::getInstance(), and aliroUser::getInstance().

00077                                                                                                                     {
00078         // activate HTML formatted emails
00079         if ($mode) $this->setHTML($this->body);
00080         else $this->setText($this->body);
00081         if(!is_array($recipient)) $recipient = array($recipient);
00082         if (isset($cc)) {
00083             if (is_array($cc)) foreach ($cc as $to) $this->setCC($to);
00084             else $this->setCC($cc);
00085         }
00086         if (isset($bcc)) {
00087             if(is_array($bcc)) foreach ($bcc as $to) $this->setBCC($to);
00088             else $this->setBCC($bcc);
00089         }
00090         if ($attachment) {
00091             if (is_array($attachment)) foreach ($attachment as $fname) $this->addAttachment($fname);
00092             else $this->addAttachment($attachment);
00093         } // if
00094         if ($replyto) {
00095             if (is_array($replyto)) {
00096                 foreach ($replyto as $to) {
00097                     $toname = ((list($key, $value) = each($replytoname))
00098                     ? $value : "");
00099                     // $this->setReplyTo($to, $toname);
00100                 }
00101             } // else $this->setReplyTo($replyto, $replytoname);
00102         }
00103         $result = $this->Send($recipient, $this->Mailer);
00104         $my = aliroUser::getInstance();
00105         $database = aliroCoreDatabase::getInstance();
00106         if (is_array($recipient)) {
00107             foreach ($recipient as &$rec) $rec= $database->getEscaped($rec);
00108             $recipient = implode (' / ', $recipient);
00109         }
00110         else $recipient = $database->getEscaped($recipient);
00111         $posted = $database->getEscaped(serialize($_POST));
00112         $userid = (string) $my->id;
00113         $database->doSQL("INSERT INTO `#__mail_log` VALUES (0, $userid, NOW(), '$this->Mailer', '$recipient', '{$_SERVER['REQUEST_URI']}', '$posted')");
00114         $database->doSQL("DELETE LOW_PRIORITY FROM `#__mail_log` WHERE date < SUBDATE(NOW(), INTERVAL 7 DAY)");
00115         return $result;
00116     } // mosMail


Member Data Documentation

mosMailer::$body = '' [private]

Reimplemented from aliroMailer.

Definition at line 41 of file aliroMailer.php.

Referenced by __construct().


The documentation for this class was generated from the following file:

Generated on Thu Apr 17 13:03:33 2008 for ALIRO by  doxygen 1.5.5