Mailer.php
authorAlan Knowles <alan@roojs.com>
Wed, 22 Aug 2012 03:25:41 +0000 (11:25 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 22 Aug 2012 03:25:41 +0000 (11:25 +0800)
Mailer.php

index 51fb949..b822a96 100644 (file)
@@ -131,7 +131,24 @@ class Pman_Core_Mailer {
             'body' => $parts[2]
         );
     }
-    
-    
+    function send()
+    {
+        
+        $email = $this->toData();
+        if (is_a($email, 'PEAR_Error')) {
+            return $email;
+        }
+        ///$recipents = array($this->email);
+        $mailOptions = PEAR::getStaticProperty('Mail','options');
+        $mail = Mail::factory("SMTP",$mailOptions);
+        $headers['Date'] = date('r');
+        if (PEAR::isError($mail)) {
+            return $mail;
+        } 
+        $oe = error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
+        $ret = $mail->send($email['recipents'],$email['headers'],$email['body']);
+        error_reporting($oe);
+       
+        return $ret;
     
 }
\ No newline at end of file