/** * メールの内容をDBに保存する * @module org.rhaco.net.mail.Mail * @param org.rhaco.net.mail.Mail $mail */ public function send_mail(\org\rhaco\net\mail\Mail $mail) { $self = new self(); $self->from($mail->from()); $self->to(implode("\n", array_keys($mail->to()))); $self->cc(implode("\n", array_keys($mail->cc()))); $self->bcc(implode("\n", array_keys($mail->bcc()))); $self->subject(mb_convert_encoding(base64_decode(preg_replace('/^=\\?ISO-2022-JP\\?B\\?(.+)\\?=$/', '\\1', $mail->subject())), 'UTF-8', 'JIS')); $self->message(mb_convert_encoding($mail->message(), 'UTF-8', 'JIS')); $self->manuscript($mail->manuscript()); $self->save(); self::commit(); }
/** Shortcut to Send Quick Messages @param $host the XMPP Host to Connect to @param $user the username @param $pass the password @param $rcpt who to send to @param $body the message @return true */ public static function sendMessage($host, $user, $pass, $rcpt, $body) { $arg = array('hostname' => $host, 'username' => $user, 'password' => $pass); $xmpp = new self($arg); $xmpp->auth(); // $xmpp->presence('<presence type=\"available\" />'); $xmpp->message($rcpt, $body); }
public static function printMessage($Message, $fullSide = true, $redirect = NULL) { $template = new self(); if (!isset($redirect)) { $redirect = array(false, 0); } $template->message($Message, $redirect[0], $redirect[1], !$fullSide); exit; }