示例#1
0
 public function run(User $user, $args)
 {
     $args = explode(' ', $args, 2);
     $userName = $args[0];
     if (!isset($args[1])) {
         RespondError::make($user, ['msg' => 'Вы не ввели сообщения']);
         return;
     }
     $text = $args[1];
     $properties = PropertiesDAO::create()->getByUserName($userName);
     if (!$properties->getId()) {
         RespondError::make($user, ['msg' => "{$userName} не зарегистрирован или имя введено не верно"]);
         return;
     }
     $address = UserDAO::create()->getById($properties->getUserId());
     $permissions = new UserActions($user->getUserDAO());
     $actions = $permissions->getAllowed($address);
     if (!in_array(UserActions::MAIL, $actions)) {
         RespondError::make($user, ['msg' => $user->getLang()->getPhrase('NoPermission')]);
         return;
     }
     //@TODO сделать отправку по крону
     //также надо ограничить частоту отправки
     $config = DI::get()->getConfig();
     $mailerName = 'СоциоЧат';
     $headers = "MIME-Version: 1.0 \n" . "From: " . mb_encode_mimeheader($mailerName) . "<" . $config->adminEmail . "> \n" . "Reply-To: " . mb_encode_mimeheader($mailerName) . "<" . $config->adminEmail . "> \n" . "Content-Type: text/html;charset=UTF-8\n";
     $topic = 'Для вас есть сообщение';
     $msg = "<h2>Вам пришло сообщение от пользователя {$user->getProperties()->getName()}</h2>";
     $msg .= '<p>' . htmlentities(strip_tags($text)) . '</p>';
     $msg .= '<hr>';
     $msg .= 'Вернуться в <a href="' . $config->domain->protocol . $config->domain->web . '">СоциоЧат</a>';
     mb_send_mail($address->getEmail(), $topic, $msg, $headers);
     RespondError::make($user, ['msg' => 'Сообщение отправлено!']);
     return ['Сообщение отправлено!', true];
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $issues = Issue::all();
     $checkIssueList = array();
     foreach ($issues as $issue) {
         $stockPricelInfos = $issue->stockPricelInfos()->where('average_75days', '!=', 0)->orderBy('acquire_at', 'DESC')->take($this->numberOfVectors)->get();
         if (count($stockPricelInfos) < 2) {
             continue;
         }
         $vectors = array();
         $i = 0;
         foreach ($stockPricelInfos as $stockPricelInfo) {
             $vectors[] = ['x' => count($stockPricelInfos) - $i, 'y' => $stockPricelInfo->average_75days];
             $i++;
         }
         $cls = new CalcLeastSquare($vectors);
         $stockPricelInfos[0]->gradient_75days = $cls->getGradient();
         $stockPricelInfos[0]->save();
         if ($stockPricelInfos[1]->gradient_75days < 0 && $stockPricelInfos[0]->gradient_75days >= 0) {
             $issue->price_up_to_date = $stockPricelInfos[0]->opening_price;
             $checkIssueList[] = $issue;
         }
     }
     if (!count($checkIssueList)) {
         return;
     }
     $mailBody = "";
     foreach ($checkIssueList as $issue) {
         $mailBody .= $issue->code . " " . $issue->name . " ¥" . number_format($issue->unit * $issue->price_up_to_date) . ' http://stocks.finance.yahoo.co.jp/stocks/chart/?code=' . $issue->code . "&ct=z&t=1y&q=c&l=off&z=m&p=s,m75,m25&a=v\n";
     }
     mb_send_mail($this->mailTo, '75日トレンド転換面柄', $mailBody);
 }
示例#3
0
 /**
  * send, Envoie le mail
  *
  * @param Message $message
  * @throws InvalidArgumentException
  * @throws MailException
  * @return bool
  */
 public function send(Message $message)
 {
     if (empty($message->getTo()) || empty($message->getSubject()) || empty($message->getMessage())) {
         throw new InvalidArgumentException("Une erreur est survenu. L'expediteur ou le message ou l'object omit.", E_USER_ERROR);
     }
     if (isset($this->config['mail'])) {
         $section = $this->config['mail']['default'];
         if (!$message->fromIsDefined()) {
             $form = $this->config['mail'][$section];
             $message->from($form["address"], $form["username"]);
         } else {
             if (!Str::isMail($message->getFrom())) {
                 $form = $this->config['mail'][$message->getFrom()];
                 $message->from($form["address"], $form["username"]);
             }
         }
     }
     $to = '';
     $message->setDefaultHeader();
     foreach ($message->getTo() as $value) {
         if ($value[0] !== null) {
             $to .= $value[0] . ' <' . $value[1] . '>';
         } else {
             $to .= '<' . $value[1] . '>';
         }
     }
     $status = @mb_send_mail($to, $message->getSubject(), $message->getMessage(), $message->compileHeaders());
     return (bool) $status;
 }
 function mailDefault($template, $to, $data)
 {
     $arrayMail = array();
     $file = file($template);
     //Get values from template mail
     foreach ($file as $value) {
         if ($value != "") {
             list($key, $val) = explode("=>", $value);
             $key = trim($key);
             $val = trim($val);
             $arrayMail[$key] = $val;
         }
     }
     $subject = $arrayMail['subject'];
     $from = $arrayMail['from'];
     $body = $arrayMail['body'];
     $body = str_replace('\\r\\n', "\n", $body);
     //			$headers .= "MIME-Version: 1.0\r\n";
     //			$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
     //			$headers  .= "From: $from\r\n";
     //push value from in parameter to body mail
     foreach ($data as $key => $item) {
         $body = str_replace('{$' . $key . '}', $item, $body);
     }
     //Execute send mail
     mb_language("Japanese");
     mb_internal_encoding("UTF-8");
     if (mb_send_mail($to, $subject, $body, "From: " . $from)) {
         return true;
     } else {
         return false;
     }
 }
示例#5
0
 /**
  * メール送信処理
  */
 public function send()
 {
     // 先ずはチェック
     $ret = $this->validation();
     // エラーがある場合は終了
     if ($ret['status']) {
         return $ret;
     }
     // 宛先作成
     $to = $this->createMailToString($this->to);
     // FROM作成
     if (empty($this->fromName)) {
         $this->header .= "From: {$this->from}\n";
     } else {
         $from_name = mb_encode_mimeheader(mb_convert_encoding($this->fromName, "JIS", "UTF-8"));
         $this->header .= "From: {$from_name} <{$this->from}>\n";
     }
     // CC作成
     $cc = $this->createMailToString($this->cc);
     if ($cc) {
         $this->header .= "Cc: {$cc}\n";
     }
     // メール送信処理
     if (mb_send_mail($to, $this->title, $this->body, $this->header)) {
         return $ret;
     } else {
         $ret['status'] = 1;
         @array_push($ret['messages'], '送信処理に失敗しました。');
         return false;
     }
 }
示例#6
0
 public static function send_attached_mail($to, $subject, $plain_message, $from, $attachment = null, $fileName = null, $attach_mime_type = null)
 {
     if ($attachment === null) {
         self::send_mail($to, $subject, $plain_message, $from);
     } else {
         $fileName = mb_encode_mimeheader(mb_convert_encoding(basename($fileName), "ISO-2022-JP", 'auto'));
         $from = mb_encode_mimeheader(mb_convert_encoding(basename($from), "ISO-2022-JP", 'auto'));
         //必要に応じて適宜文字コードを設定してください。
         mb_language('Ja');
         mb_internal_encoding('UTF-8');
         $boundary = '__BOUNDARY__' . md5(rand());
         $headers = "Content-Type: multipart/mixed;boundary=\"{$boundary}\"\n";
         $headers .= "From: {$from}<{$from}>\n";
         $headers .= "Reply-To: {$from}\n";
         $body = "--{$boundary}\n";
         $body .= "Content-Type: text/plain; charset=\"ISO-2022-JP\"\n";
         $body .= "\n{$plain_message}\n";
         $body .= "--{$boundary}\n";
         $body .= "Content-Type: {$attach_mime_type}; name=\"{$fileName}\"\n";
         $body .= "Content-Disposition: attachment; filename=\"{$fileName}\"\n";
         $body .= "Content-Transfer-Encoding: base64\n";
         $body .= "\n";
         $body .= chunk_split(base64_encode($attachment)) . "\n";
         $body .= "--{$boundary}--";
         $ret = mb_send_mail($to, $subject, $body, $headers);
         return $ret;
     }
 }
示例#7
0
 function send()
 {
     global $tpl, $opt, $login;
     if (!$this->template_exists($this->name . '.tpl')) {
         $tpl->error(ERROR_MAIL_TEMPLATE_NOT_FOUND);
     }
     $this->assign('template', $this->name);
     $optn['mail']['contact'] = $opt['mail']['contact'];
     $optn['page']['absolute_url'] = $opt['page']['absolute_url'];
     $optn['format'] = $opt['locale'][$opt['template']['locale']]['format'];
     $this->assign('opt', $optn);
     $this->assign('to', $this->to);
     $this->assign('from', $this->from);
     $this->assign('subject', $this->subject);
     $llogin['username'] = isset($login) ? $login->username : '';
     $this->assign('login', $llogin);
     $body = $this->fetch($this->main_template . '.tpl', '', $this->get_compile_id());
     // check if the target domain exists if the domain does not
     // exist, the mail is sent to the own domain (?!)
     $domain = mail::getToMailDomain($this->to);
     if (mail::is_existent_maildomain($domain) == false) {
         return false;
     }
     $aAddHeaders = array();
     $aAddHeaders[] = 'From: "' . $this->from . '" <' . $this->from . '>';
     if ($this->replyTo !== null) {
         $aAddHeaders[] = 'Reply-To: ' . $this->replyTo;
     }
     if ($this->returnPath !== null) {
         $aAddHeaders[] = 'Return-Path: ' . $this->returnPath;
     }
     $mailheaders = implode("\n", array_merge($aAddHeaders, $this->headers));
     return mb_send_mail($this->to, $opt['mail']['subject'] . $this->subject, $body, $mailheaders);
 }
 public static function mail_to($value, $mails)
 {
     //return md5($value);
     mb_language("japanese");
     mb_internal_encoding("utf-8");
     $email = mb_encode_mimeheader("チラシシステム") . "<*****@*****.**>";
     $subject = $value["title"];
     $body = $value["text"];
     //$from = "lightbox@sdc";
     //ini_set( "SMTP", "localhost" );
     //ini_set( "smtp_port", 25 );
     //ini_set( "sendmail_from", $from );
     $bccs = implode(' ,', $mails);
     $header = "From: " . mb_encode_mimeheader("チラシシステム") . "<*****@*****.**>";
     $header .= "\n";
     $header = "Bcc:" . $bccs;
     //$header ="Bcc:zuo@it-art.jp,zou@shift-jp.net";
     $header .= "\n";
     if (!@mb_send_mail(NULL, $subject, $body, $header)) {
         // echo "*********mb_send_mailエラー**************";
         return false;
     } else {
         //echo "*********sucess**************";
         return true;
     }
 }
function wpbl_notify($comment_id, $reason, $harvest)
{
    global $wpdb, $wp_id, $url, $email, $comment, $user_ip, $comment_post_ID, $author, $tableposts;
    $tableposts = $wpdb->posts[$wp_id];
    $sql = "SELECT * FROM {$tableposts} WHERE ID='{$comment_post_ID}' LIMIT 1";
    $post = $wpdb->get_row($sql);
    if (!empty($user_ip)) {
        $comment_author_domain = gethostbyaddr($user_ip);
    } else {
        $comment_author_domain = '';
    }
    // create the e-mail body
    $notify_message = "A new comment on post #{$comment_post_ID} \"" . stripslashes($post->post_title) . "\" has been automatically deleted by the WPBlacklist plugin.\r\n\r\n";
    $notify_message .= "Author : {$author} (IP: {$user_ip} , {$comment_author_domain})\r\n";
    $notify_message .= "E-mail : {$email}\r\n";
    $notify_message .= "URL    : {$url}\r\n";
    $notify_message .= "Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput={$user_ip}\r\n";
    $notify_message .= "Comment:\r\n" . stripslashes($comment) . "\r\n\r\n";
    $notify_message .= "Triggered by : {$reason}\r\n\r\n";
    // add harvested info - if there is any
    if (!empty($harvest)) {
        $notify_message .= "Harvested the following information:\r\n" . stripslashes($harvest);
    }
    // e-mail header
    $subject = '[' . stripslashes(get_settings('blogname')) . '] Automatically deleted: "' . stripslashes($post->post_title) . '"';
    $admin_email = get_settings("admin_email");
    $from = "From: {$admin_email}";
    // send e-mail
    if (function_exists('mb_send_mail')) {
        mb_send_mail($admin_email, $subject, $notify_message, $from);
    } else {
        @mail($admin_email, $subject, $notify_message, $from);
    }
    return true;
}
示例#10
0
 public function resultAction()
 {
     $post = $this->request->getPost();
     $email = $post["email"];
     $error = array();
     if ("" == $email) {
         array_push($error, "メールアドレスを入力してください");
     } else {
         $pre_user_id = uniqid(rand(100, 999));
         $userModel = new Users();
         $result = $userModel->addEmail(array($pre_user_id, $email));
         if (false == $result) {
             array_push($error, "データベースに登録できませんでした。");
         } else {
             mb_language("japanese");
             mb_internal_encoding("utf-8");
             $to = $email;
             $subject = "seapaメンバー登録URL";
             $message = "以下のURLよりメンバー登録を行ってください。\n" . "http://localhost/regist/input/{$pre_user_id}";
             $header = "From: mail.seapa@gmail.com";
             if (!mb_send_mail($to, $subject, $message, $header, '-f' . '*****@*****.**')) {
                 array_push($error, "メールが送信できませんでした。<a href='http://localhost/regist/input/{$pre_user_id}'>遷移先</a>");
             }
             $this->view->assign('email', $email);
         }
     }
 }
示例#11
0
文件: email.class.php 项目: roc/Borax
    static function sendRaw($address, $subject, $body)
    {
        $headers = null;
        $from = SITE_EMAIL;
        if (!defined('DISABLE_EMAILS') || !DISABLE_EMAILS) {
            return mb_send_mail($address, $subject, $body, $headers, " -t -i -F " . SITE_NAME . " -f {$from}");
        } else {
            $dt = new DateTime();
            $date = $dt->format('D j M Y g:ia');
            $from = SITE_EMAIL;
            $msg = <<<EOF

From: {$from}
To: {$address}
Subject: {$subject}
Date: {$date}
{$headers}

{$body}

=======================================================
=======================================================

EOF;
            file_put_contents(ROOT_DIR . '/mail.log', $msg, FILE_APPEND);
            return true;
        }
    }
示例#12
0
 public function send($email, $topic, $msg)
 {
     $config = DI::get()->getConfig()->mail;
     $mailerName = $config->name;
     $headers = "MIME-Version: 1.0 \n" . "From: " . mb_encode_mimeheader($mailerName) . "<" . $config->adminEmail . "> \n" . "Reply-To: " . mb_encode_mimeheader($mailerName) . "<" . $config->adminEmail . "> \n" . "Content-Type: text/html;charset=UTF-8\n";
     mb_send_mail($email, $topic, $msg, $headers);
 }
示例#13
0
 public function noticePackageUploaded(Package $pkg)
 {
     $app = $this->app;
     $package_url = mfwRequest::makeURL("/package?id={$pkg->getId()}");
     ob_start();
     include APP_ROOT . '/data/notice_mail_template.php';
     $body = ob_get_clean();
     $addresses = array();
     foreach ($this->rows as $r) {
         if ($r['notify']) {
             $addresses[] = $r['mail'];
         }
     }
     if (empty($addresses)) {
         return;
     }
     $subject = "New Package Uploaded to {$app->getTitle()}";
     $sender = Config::get('mail_sender');
     $to = $sender;
     $header = "From: {$sender}" . "\nBcc: " . implode(', ', $addresses);
     mb_language('uni');
     mb_internal_encoding('UTF-8');
     if (!mb_send_mail($to, $subject, $body, $header)) {
         throw new RuntimeException("mb_send_mail faild (pkg={$pkg->getId()}, {$pkg->getTitle()})");
     }
 }
示例#14
0
 /**
  * @see	\wcf\system\mail\MailSender::sendMail()
  */
 public function sendMail(Mail $mail)
 {
     if (MAIL_USE_F_PARAM) {
         return @mb_send_mail($mail->getToString(), $mail->getSubject(), $mail->getBody(), $mail->getHeader(), '-f' . MAIL_FROM_ADDRESS);
     } else {
         return @mb_send_mail($mail->getToString(), $mail->getSubject(), $mail->getBody(), $mail->getHeader());
     }
 }
示例#15
0
function mb_send_mail_2($to, $subject, $content, $headers)
{
    global $debug_page;
    if ($debug_page) {
        echo "<pre>mail\nto: {$to}\nsubject: {$subject}\n{$content}</pre>";
    } else {
        mb_send_mail($to, $subject, $content, $headers);
    }
}
示例#16
0
 function mailsend($mailto, $subject, $messages)
 {
     mb_language("Ja");
     mb_internal_encoding("UTF-8");
     $mail_from = MAILFROM;
     $mailfrom = "From:" . mb_encode_mimeheader(MAILFROMNAME) . "<{$mail_from}>";
     if (mb_send_mail($mailto, $subject, $messages, $mailfrom)) {
     }
 }
示例#17
0
 public function send($to = "*****@*****.**", $body = "テスト")
 {
     mb_language("japanese");
     mb_internal_encoding("UTF-8");
     //日本語メール送信
     $subject = MAIL_SUBJECT;
     $from = MAIL_FROM;
     mb_send_mail($to, $subject, $body, "From:" . $from);
 }
示例#18
0
 /**
  * メール送信をします
  *
  * @param string $from 送り元メールアドレス
  * @param string $to 送り先メールアドレス
  * @param string $message メール本文(+タイトル)
  * @throws MailSenderException
  */
 function send($from, $to, $message)
 {
     $message = str_replace("\r\n", "\n", $message);
     list($subject, $body) = @explode("\n\n", $message, 2);
     mb_language('ja');
     $result = @mb_send_mail($to, $subject, $body, "From: {$from}", '-f' . $from);
     if ($result === false) {
         throw new MailSenderException('test', MailSenderException::CODE_FAILED_TO_SEND_MAIL);
     }
 }
示例#19
0
 /**
  * メッセージをメールに書く(メールを送る)<br />
  * 
  * <note>決して手動で呼んではいけない</note>
  *
  * @param string 書かれるメッセージ
  * @access public
  * @since  2.0
  */
 function write($message)
 {
     $header = "X-Mailer: " . SMTP_APPENDER_XMAILER . "\r\n";
     if ($this->from) {
         $header .= "From: " . $this->from;
     }
     if (!mb_send_mail($this->to, $this->subject, $message)) {
         trigger_error("Failed to send mail to " . $this->to, E_USER_ERROR);
     }
 }
示例#20
0
function process_new_cache($notify)
{
    global $debug, $debug_mailto, $rootpath;
    global $mailfrom, $new_cache_subject, $new_oconly_subject;
    //echo "process_new_cache(".$notify['id'].")\n";
    $error = false;
    // mail-template lesen
    switch ($notify['type']) {
        case notify_new_cache:
            // Type: new cache
            $mailbody = read_file($rootpath . 'util/notification/notify_newcache.email');
            $mailsubject = $new_cache_subject;
            break;
        case notify_new_oconly:
            // Type: new OConly flag
            $mailbody = read_file($rootpath . 'util/notification/notify_newoconly.email');
            $mailsubject = $new_oconly_subject;
            break;
        default:
            $error = true;
            break;
    }
    if (!$error) {
        $mailbody = mb_ereg_replace('{username}', $notify['recpname'], $mailbody);
        $mailbody = mb_ereg_replace('{date}', date('d.m.Y', strtotime($notify['date_hidden'])), $mailbody);
        $mailbody = mb_ereg_replace('{cacheid}', $notify['cache_id'], $mailbody);
        $mailbody = mb_ereg_replace('{wp_oc}', $notify['wp_oc'], $mailbody);
        $mailbody = mb_ereg_replace('{user}', $notify['username'], $mailbody);
        $mailbody = mb_ereg_replace('{cachename}', $notify['cachename'], $mailbody);
        $mailbody = mb_ereg_replace('{distance}', round(calcDistance($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'], 1), 1), $mailbody);
        $mailbody = mb_ereg_replace('{unit}', 'km', $mailbody);
        $mailbody = mb_ereg_replace('{bearing}', Bearing2Text(calcBearing($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'])), $mailbody);
        $mailbody = mb_ereg_replace('{cachetype}', $notify['cachetype'], $mailbody);
        $mailbody = mb_ereg_replace('{cachesize}', $notify['cachesize'], $mailbody);
        $mailbody = mb_ereg_replace('{oconly}', $notify['oconly'] ? 'OConly-' : '', $mailbody);
        $subject = mb_ereg_replace('{cachename}', $notify['cachename'], $mailsubject);
        $subject = mb_ereg_replace('{oconly}', $notify['oconly'] ? 'OConly-' : '', $subject);
        /* begin send out everything that has to be sent */
        $email_headers = 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
        // mail versenden
        if ($debug == true) {
            $mailadr = $debug_mailto;
        } else {
            $mailadr = $notify['email'];
        }
        if (is_existent_maildomain(getToMailDomain($mailadr))) {
            mb_send_mail($mailadr, $subject, $mailbody, $email_headers);
        }
    } else {
        echo "Unbekannter Notification-Typ: " . $notify['type'] . "<br />";
    }
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('notify_newcache', 8, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, array());
    return 0;
}
示例#21
0
function funcContactAddress($email, $name)
{
    //言語設定、内部エンコーディングを指定する
    mb_language("japanese");
    mb_internal_encoding("EUC-JP");
    $to = $email;
    $subject = "登録";
    $body = "登録ありがとうございます";
    $from = "*****@*****.**";
    mb_send_mail($to, $subject, $body, $from);
}
示例#22
0
 public function send($recipient, $subject, $message, $sender_fullname = "", $sender_email)
 {
     $header = "From: {$sender_fullname}" . "<" . strip_tags($sender_email) . ">";
     $header .= "\nMIME-Version: 1.0\n";
     //Multipurpose Internet Mail Extensions
     $header .= "Content-Type: text/html; charset=\"utf-8\"\n";
     //Vytvorenie hlavicky emailu
     if (!mb_send_mail($recipient, $subject, $message, $header)) {
         throw new UserError('Niekde nastala neočakávaná chyba.');
     }
 }
示例#23
0
文件: mail.php 项目: utumdol/codeseed
/**
 * 메일을 HTML 형태로 발송한다.
 */
function html_mail($to, $subject, $message, $from = 'codeseed <*****@*****.**>')
{
    $headers = array();
    $headers[] = "MIME-Version: 1.0";
    $headers[] = "Content-Type: text/html; charset=utf-8";
    $headers[] = "Content-Transfer-Encoding: 8bit";
    $headers[] = "From: {$from}";
    $headers[] = "Reply-To: {$from}";
    $headers[] = "X-Mailer: PHP/" . phpversion();
    mb_internal_encoding('UTF-8');
    mb_send_mail($to, $subject, $message, implode(NL, $headers));
}
function wpbl_notify($comment_id, $reason, $harvest)
{
    global $wbbl_comment;
    $tableposts = wp_table('posts');
    $sql = "SELECT * FROM {$tableposts} WHERE ID='{$wbbl_comment['comment_post_ID']}' LIMIT 1";
    $post = $GLOBALS['wpdb']->get_row($sql);
    if (!empty($wpbl_comment['comment_author_IP'])) {
        $comment_author_domain = gethostbyaddr($wpbl_comment['comment_author_IP']);
    } else {
        $comment_author_domain = '';
    }
    // create the e-mail body
    $notify_message = "A new ";
    if ($wpbl_comment['comment_type'] == '') {
        $notify_message .= "Comment";
    } else {
        if ($wpbl_comment['comment_type'] == 'trackback') {
            $notify_message .= "TrackBack";
        } else {
            if ($wpbl_comment['comment_type'] == 'pingback') {
                $notify_message .= "PingBack";
            }
        }
    }
    $notify_message .= " on post #{$wbbl_comment['comment_post_ID']} \"" . stripslashes($post->post_title) . "\" has been automatically deleted by the WPBlacklist plugin.\r\n\r\n";
    $notify_message .= "Author : {$wpbl_comment['comment_author']} (IP: {$wpbl_comment['comment_author_IP']} , {$comment_author_domain})\r\n";
    $notify_message .= "E-mail : {$wpbl_comment['comment_author_email']}\r\n";
    $notify_message .= "URL    : {$wpbl_comment['comment_author_url']}\r\n";
    $notify_message .= "Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput={$wpbl_comment['comment_author_IP']}\r\n";
    $notify_message .= "Comment:\r\n" . stripslashes($wpbl_comment['comment_content']) . "\r\n\r\n";
    $notify_message .= "Triggered by : {$reason}\r\n\r\n";
    // add harvested info - if there is any
    if (!empty($harvest)) {
        $notify_message .= "Harvested the following information:\r\n" . stripslashes($harvest);
    }
    // e-mail header
    $subject = '[' . stripslashes(get_settings('blogname')) . '] Automatically deleted: "' . stripslashes($post->post_title) . '"';
    $admin_email = get_settings("admin_email");
    $from = "From: {$admin_email}";
    if (strtolower(get_settings('blog_charset')) == "euc-jp") {
        $mail_charset = "iso-2022-jp";
    } else {
        $mail_charset = get_settings('blog_charset');
    }
    $message_headers = "MIME-Version: 1.0\r\n" . "{$from}\r\n" . "Content-Type: text/plain; charset=\"" . $mail_charset . "\"\r\n";
    // send e-mail
    if (function_exists('mb_send_mail')) {
        mb_send_mail($admin_email, $subject, $notify_message, $from);
    } else {
        @mail($admin_email, $subject, $notify_message, $from);
    }
    return true;
}
示例#25
0
 public function toMail($address, $title, $str)
 {
     mb_language("Japanese");
     mb_internal_encoding("UTF-8");
     // 要送信元変更
     if (mb_send_mail($address, $title, $str, "From: info@gmail.ne.jp")) {
         //   if(mb_send_mail("*****@*****.**","たいとる","本文","From: info@gmail.ne.jp")){
         return "メールが送信されました。";
     } else {
         return "メールの送信に失敗しました。";
     }
 }
示例#26
0
function process_new_cache($notify)
{
    global $opt, $debug, $debug_mailto, $rootpath, $translate;
    global $maildomain, $mailfrom;
    //echo "process_new_cache(".$notify['id'].")\n";
    $error = false;
    // fetch email template
    switch ($notify['type']) {
        case notify_new_cache:
            // Type: new cache
            $mailbody = fetch_email_template('notify_newcache', $notify['recp_lang'], $notify['recp_domain']);
            $mailsubject = '[' . $maildomain . '] ' . $translate->t($notify['oconly'] ? 'New OConly cache:' : 'New cache:', '', basename(__FILE__), __LINE__, '', 1, $notify['recp_lang']) . ' ' . $notify['cachename'];
            break;
        case notify_new_oconly:
            // Type: new OConly flag
            $mailbody = fetch_email_template('notify_newoconly', $notify['recp_lang'], $notify['recp_domain']);
            $mailsubject = '[' . $maildomain . '] ' . $translate->t('Cache was marked as OConly:', '', basename(__FILE__), __LINE__, '', 1, $notify['recp_lang']) . ' ' . $notify['cachename'];
            break;
        default:
            $error = true;
            break;
    }
    if (!$error) {
        $mailbody = mb_ereg_replace('{username}', $notify['recpname'], $mailbody);
        $mailbody = mb_ereg_replace('{date}', date($opt['locale'][$notify['recp_lang']]['format']['phpdate'], strtotime($notify['date_hidden'])), $mailbody);
        $mailbody = mb_ereg_replace('{cacheid}', $notify['cache_id'], $mailbody);
        $mailbody = mb_ereg_replace('{wp_oc}', $notify['wp_oc'], $mailbody);
        $mailbody = mb_ereg_replace('{user}', $notify['username'], $mailbody);
        $mailbody = mb_ereg_replace('{cachename}', $notify['cachename'], $mailbody);
        $mailbody = mb_ereg_replace('{distance}', round(geomath::calcDistance($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2'], 1), 1), $mailbody);
        $mailbody = mb_ereg_replace('{unit}', 'km', $mailbody);
        $mailbody = mb_ereg_replace('{bearing}', geomath::Bearing2Text(geomath::calcBearing($notify['lat1'], $notify['lon1'], $notify['lat2'], $notify['lon2']), 0, $notify['recp_lang']), $mailbody);
        $mailbody = mb_ereg_replace('{cachetype}', get_cachetype_name($notify['cachetype'], $notify['recp_lang']), $mailbody);
        $mailbody = mb_ereg_replace('{cachesize}', get_cachesize_name($notify['cachesize'], $notify['recp_lang']), $mailbody);
        $mailbody = mb_ereg_replace('{oconly-}', $notify['oconly'] ? $translate->t('OConly-', '', basename(__FILE__), __LINE__, '', 1, $notify['recp_lang']) : '', $mailbody);
        /* begin send out everything that has to be sent */
        $email_headers = 'From: "' . $mailfrom . '" <' . $mailfrom . '>';
        // send email
        if ($debug == true) {
            $mailadr = $debug_mailto;
        } else {
            $mailadr = $notify['email'];
        }
        if (is_existent_maildomain(getToMailDomain($mailadr))) {
            mb_send_mail($mailadr, $mailsubject, $mailbody, $email_headers);
        }
    } else {
        echo "Unknown notification type: " . $notify['type'] . "<br />";
    }
    // logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
    logentry('notify_newcache', 8, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, []);
    return 0;
}
示例#27
0
 public static function sendAlertMail($to, $subject, $body)
 {
     if (!is_array($to)) {
         $to_arr = array($to);
     } else {
         $to_arr = $to;
     }
     foreach ($to_arr as $to_ad) {
         //送信
         mb_send_mail($to_ad, $subject, $body, "From:" . self::$sys_mail_add);
     }
 }
示例#28
0
文件: Model.php 项目: vane00ssa/TMS2
 public function sendEmail($from, $to, $subject, $message)
 {
     $header = "MIME-Version: 1.0" . PHP_EOL;
     $header .= 'Content-Type: text/html; charset=UTF-8' . PHP_EOL;
     $header .= 'From: ' . $from . PHP_EOL;
     //$header .= 'Content-Transfer-Encoding: base64';
     //$subject = mb_encode_mimeheader($subject, "UTF-8");
     $result = mb_send_mail($to, $subject, $message, $header);
     if (!$result) {
         $this->newTicket('error', 'mail sending', 'email was not sent. \\$to: ' . $to . ' ,\\$subject: ' . $subject . ' ,\\$message: ' . $message . ' ,\\header: ' . $header);
     }
     return $result;
 }
示例#29
0
 /**
  * @param[in] string $sender 送信アドレス
  */
 public function sendResetMail()
 {
     $data = array('mail' => $this->row['mail'], 'microtime' => microtime());
     $key = sha1(json_encode($data));
     mfwMemcache::set($key, $data, self::RESET_MAIL_EXPIRE);
     $url = mfwRequest::makeUrl("/login/password_reset?key={$key}");
     $subject = 'Reset password';
     $to = $data['mail'];
     $from = 'From: ' . Config::get('mail_sender');
     $body = "EMLauncher password reset URL:\n{$url}\n";
     if (!mb_send_mail($to, $subject, $body, $from)) {
         throw new RuntimeException("mb_send_mail faild (key:{$key} to:{$to})");
     }
 }
示例#30
0
 /**
  * 
  * @see Ethna_ActionClass::perform()
  */
 function perform()
 {
     $days = $this->config->get('license_warning_days');
     try {
         $licenseDao = DaoFactory::LicenseMst();
         $userDao = DaoFactory::UserMst();
         $companyDao = DaoFactory::CompanyMst();
         sort($days, SORT_NUMERIC);
         $result = array();
         foreach ($days as $day) {
             $params = array('day' => $day);
             $res = $licenseDao->LicenseMST_GetLicenseValidDays($params)->fetchAll(PDO::FETCH_ASSOC);
             $result = array_merge($result, $res);
         }
         foreach ($result as $value) {
             $send_email[$value['COMPANY_ID']][] = array('TERMINAL_ID' => $value['TERMINAL_ID'], 'END_YMD' => $value['END_YMD']);
         }
         //send e-mail
         $headers = "From: {$this->config->get('admin_email_address')}";
         foreach ($send_email as $company => $arr) {
             $invalid_terminal_list = '';
             foreach ($arr as $key => $value) {
                 $invalid_terminal_list .= "\n{$value['TERMINAL_ID']}\t\t\t{$value['END_YMD']}";
             }
             //get admin user's e-mail address and language
             $companyInfo = $companyDao->Retrieve('COMPANY_ID = ?', array($company));
             //$companyInfo['CONTACT']
             $userInfo = $userDao->Retrieve("LOGIN_ID = 'admin' AND COMPANY_ID = ? ", array($company));
             //$userInfo['E_MAIL']
             //$userInfo['DEFAULT_LOCALE']  zh-Hans-CN en_US ja_JP
             if ($userInfo['DEFAULT_LOCALE'] == 'zh-Hans-CN') {
                 $this->backend->getController()->setLocale('zh-Hans-CN');
                 $subject = _et($this->config->get('system_name')) . "终端证书即将到期";
                 $send_message = "\n{$companyInfo['COMPANY_NAME']} \n{$companyInfo['CONTACT']} 您好!\n        \t\n非常感谢您使用我们的{$this->config->get('app_name')}服务。\n您的以下终端的证书即将过期,为了不影响业务请尽快到证书管理页面购买新的证书。\n\n终端\t\t\t到期日\n" . $invalid_terminal_list . "\n\n新的证书可以从后台管理系统的证书管理页面购买,也可以直接到AsShop购买。\n如有任何问题请随即和我们取得联系。\n\n服务总站 http://www.asx4.net\nAsWiki\t\thttps://wiki.asx4.net\nAsHelp \thttps://support.asx4.net\nAsShop\thttps://ec.asx4.net\n    \t\n";
             } elseif ($userInfo['DEFAULT_LOCALE'] == 'ja_JP') {
                 $this->backend->getController()->setLocale('ja_JP');
                 $subject = _et($this->config->get('system_name')) . "端末のライセンスの期限が近づいています";
                 $send_message = "\n{$companyInfo['COMPANY_NAME']} \n{$companyInfo['CONTACT']} 様\n        \t\n{$this->config->get('app_name')}をご利用いただきまして誠にありがとうございます。\n下記の端末のライセンスの期限が近づいています。業務に影響を与えないように早めに新しいライセンスをご購入ください。\n\n端末ID\t\t\t期限\n" . $invalid_terminal_list . "\n\nライセンスは管理画面のライセンスマスタ画面か、AsShopからご購入いただけます。\nご不明な点がございましたら、お問い合わせください。\n\nサービスホーム http://www.asx4.net\nAsWiki \t\t\t\thttps://wiki.asx4.net\nAsHelp \t\t\t\thttps://support.asx4.net\nAsShop  \t\t\t\thttps://ec.asx4.net    \n    \t\n";
             } else {
                 $this->backend->getController()->setLocale('en_US');
                 $subject = _et($this->config->get('system_name')) . " Terminal will be out of license soon";
                 $send_message = "\n{$companyInfo['COMPANY_NAME']} \nHi {$companyInfo['CONTACT']}\n        \t\nThanks for using our {$this->config->get('app_name')} service. \nThe following terminal will be out of license soon. Please buy new license as soon as possible.\n\nTerminal ID\t\t\tValid Until\n" . $invalid_terminal_list . "\n\nYou can buy new licenses from the LICENSE MANAGEMENT page in our admin system or buy form the AsShop directly.\nIf you have any question, please don't hesitate to contact us.\n\nService Home\t\thttp://www.asx4.net\nAsWiki \t\t\thttps://wiki.asx4.net\nAsHelp \t\t\thttps://support.asx4.net\nAsShop  \t\t\thttps://ec.asx4.net\n";
             }
             mb_send_mail($userInfo['E_MAIL'], $subject, $send_message, $headers);
         }
     } catch (Exception $e) {
         $this->logger->log(LOG_ERR, $e->getMessage());
         die($e->getMessage());
     }
 }