$row['id'],'fullname'=>$row['fullname'],'email'=>$row['email']); } return $results; } // get_users /** * add_statistics * This should be run if we want to add some statistics to this e-mail, appends to self::$message */ public static function add_statistics($methods) { } // add_statistics /** * send * This actually sends the mail, how amazing */ public static function send() { $mailtype = Config::get('mail_type'); $mail = new PHPMailer(); $mail->AddAddress(self::$to, self::$fullname); $mail->CharSet = Config::get('site_charset'); $mail->Encoding = "base64"; $mail->From = self::$sender; $mail->Sender = self::$sender; $mail->FromName = self::$fromname; $mail->Subject = self::$subject; $mail->Body = self::$message; $mailhost = Config::get('mail_host'); $mailport = Config::get('mail_port'); $mailauth = Config::get('mail_auth'); switch($mailtype) { case 'smtp': $mail->IsSMTP(); isset($mailhost) ? $mail->Host = $mailhost : $mail->Host = "localhost"; isset($mailport) ? $mail->Port = $mailport : $mail->Port = 25; if($mailauth == true) { $mail->SMTPAuth(true); $mailuser = Config::get('mail_auth_user'); $mailpass = Config::get('mail_auth_pass'); isset($mailuser) ? $mail->Username = $mailuser : $mail->Username = ""; isset($mailpass) ? $mail->Password = $mailpass : $mail->Password = ""; } break; case 'sendmail': $mail->IsSendmail(); $sendmail = Config::get('sendmail_path'); isset($sendmail) ? $mail->Sendmail = $sendmail : $mail->Sendmail = "/usr/sbin/sendmail"; break; case 'php': default: $mail->IsMail(); break; } $retval = $mail->send(); if( $retval == true ) { return true; } else { return false; } } // send } // AmpacheMail class ?>