/** * Constructor withs initialize the IMAP object <code> array( 'host' => 'imap_host', 'port' => 'imap_port', 'user' => 'imap_user', 'password' => 'imap_password', 'ssl' => 'imap_ssl ); </code> @param array $options */ public function __construct($options = array()) { rb::connectExisting(); if (empty($options)) { $options = array('host' => conf::getMainIni('imap_host'), 'port' => conf::getMainIni('imap_port'), 'user' => conf::getMainIni('imap_user'), 'password' => conf::getMainIni('imap_password'), 'ssl' => conf::getMainIni('imap_ssl')); } $this->options = $options; }
/** * adds a mail to the queue * @param type $to * @param type $mime_headers * @param type $body * @return type */ public static function add($to, $mime_headers, $body) { rb::connectExisting(); $bean = rb::getBean('mailerqueue'); $bean->to = $to; $bean->mimeheaders = serialize($mime_headers); $bean->body = $body; $bean->sendtime = self::getDateTime(); $bean->sent = 0; $bean->domain = helpers::getDomain($to); return R::store($bean); }
public function __construct() { rb::connectExisting(); }
<?php namespace modules\event; use diversen\db\rb; rb::connectExisting(); class import { public function getAryFromTxt($txt) { $final = []; $txt = str_replace(array('>', '<'), array('', ''), $txt); $ary = explode(',', $txt); foreach ($ary as $val) { $a = explode('" ', $val); $a[0] = trim(str_replace('"', '', $a[0])); $a[1] = trim($a[1]); $final[] = $a; } return $final; } public function addToDb($ary) { foreach ($ary as $val) { $b = rb::getBean('account', 'email', $val[1]); $b->username = $val[0]; $b->email = \diversen\strings\mb::tolower($val[1]); $b->password = md5('secret1972'); $b->type = 'email'; $b->verified = 1; rb::commitBean($b);