当前位置: 首页>>代码示例>>PHP>>正文


PHP Utils::mail方法代码示例

本文整理汇总了PHP中Utils::mail方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::mail方法的具体用法?PHP Utils::mail怎么用?PHP Utils::mail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils的用法示例。


在下文中一共展示了Utils::mail方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_comment_insert_after

    public function action_comment_insert_after($comment)
    {
        // we should only execute on comments, not pingbacks
        // and don't bother if the comment is know to be spam
        if ($comment->type != Comment::COMMENT || $comment->status == Comment::STATUS_SPAM) {
            return;
        }
        $post = Post::get(array('id' => $comment->post_id));
        $author = User::get_by_id($post->user_id);
        $status = $comment->status == Comment::STATUS_UNAPPROVED ? ' UNAPPROVED' : ' approved';
        $title = _t('[%1$s] New%3$s comment on: %2$s', array(Options::get('title'), $post->title, $status));
        $message = <<<MESSAGE
The following comment was added to the post "%1\$s".
%2\$s

Author: %3\$s <%4\$s>
URL: %5\$s

%6\$s

-----
Moderate comments: %7\$s
MESSAGE;
        $message = _t($message);
        $message = sprintf($message, $post->title, $post->permalink, $comment->name, $comment->email, $comment->url, $comment->content, URL::get('admin', 'page=comments'));
        $headers = array('MIME-Version: 1.0', 'Content-type: text/plain; charset=utf-8', 'Content-Transfer-Encoding: 8bit', 'From: ' . $this->mh_utf8($comment->name) . ' <' . $comment->email . '>');
        Utils::mail($author->email, $this->mh_utf8($title), $message, implode(PHP_EOL, $headers));
    }
开发者ID:habari-extras,项目名称:comment_notifier,代码行数:28,代码来源:comment_notifier.plugin.php

示例2: process_jambo

 function process_jambo($form)
 {
     // get the values and the stored options.
     $email = array();
     $email['sent'] = false;
     $email['send_to'] = Options::get('jambo__send_to');
     $email['name'] = $form->jambo_name->value;
     $email['email'] = $form->jambo_email->value;
     $email['subject'] = Options::get('jambo__subject');
     $email['message'] = $form->jambo_message->value;
     $email['success_msg'] = Options::get('jambo__success_msg', 'Thank you contacting me. I\'ll get back to you as soon as possible.');
     /*		// interesting stuff, this OSA business. If it's not covered by FormUI, maybe it should be.
     		$email['osa'] =            $this->handler_vars['osa'];
     		$email['osa_time'] =       $this->handler_vars['osa_time'];
     */
     // Utils::mail expects an array
     $email['headers'] = array('MIME-Version' => '1.0', 'From' => "{$email['name']} <{$email['email']}>", 'Content-Type' => 'text/plain; charset="utf-8"');
     // 		$email = Plugins::filter( 'jambo_email', $email /* something */ );
     $email['sent'] = Utils::mail($email['send_to'], $email['subject'], $email['message'], $email['headers']);
     return '<p class="jambo-confirmation">' . $email['success_msg'] . '</p>';
 }
开发者ID:ringmaster,项目名称:jambo,代码行数:21,代码来源:jambo-formui.plugin.php

示例3: act_password_reset

 /**
  * Handle password reset confirmations
  */
 public function act_password_reset()
 {
     Utils::check_request_method(array('GET', 'HEAD', 'POST'));
     $id = $this->handler_vars['id'];
     $hash = $this->handler_vars['hash'];
     $name = '';
     if ($user = User::get($id)) {
         if ($user->info->password_reset == md5($hash)) {
             // Send a new random password
             $password = Utils::random_password();
             $user->password = Utils::crypt($password);
             if ($user->update()) {
                 $message = _t("Your password for %1\$s has been reset.  Your credentials are as follows---\nUsername: %2\$s\nPassword: %3\$s", array(Site::get_url('habari'), $user->username, $password));
                 Utils::mail($user->email, _t('[%1$s] Password has been reset for %2$s', array(Options::get('title'), $user->displayname)), $message);
                 Session::notice(_t('A new password has been sent to the user.'));
             } else {
                 Session::notice(_t('There was a problem resetting the password.  It was not reset.'));
             }
             // Clear the request - it should only work once
             unset($user->info->password_reset);
             $user->info->commit();
             $name = $user->username;
         } else {
             Session::notice(_t('The supplied password reset token has expired or is invalid.'));
         }
     }
     // Display the login form.
     $this->login_form($name);
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:32,代码来源:userhandler.php

示例4: update

    function update($title, $text)
    {
        $session = Session::singletone();
        if ($this->_dbo->comment_title == $title && $this->_dbo->comment_text == $text) {
            return;
        }
        $o_title = $this->_dbo->comment_title;
        $o_text = $this->_dbo->comment_text;
        $this->_dbo->comment_title = $title;
        $this->_dbo->comment_text = $text;
        $this->_dbo->update();
        $photo = new Photo($this->_dbo->photo_id);
        if ($photo->_dbo->user_id != $session->_uid) {
            $user = new User($session->_uid);
            $to_name = $photo->_user->user_login;
            $photo_title = $photo->_dbo->photo_title;
            $author = $user->_dbo->user_login;
            $body = <<<EOT
Witaj {$to_name},

Uytkownik {$author} wyedytowa komentarz do Twojego zdj�ia "{$photo_title}".

Obecna tre�komentarza:

{$title}

{$text}

----

Poprzednia tre�komentarza:

{$o_title}

{$o_text}

-- 
Ten email zosta wysany automatycznie. Prosimy nie odpowiada�
EOT;
            Utils::mail("Komentarz do Twojego zdj�ia \"{$photo_title}\" zosta zmieniony.", $body, $photo->_user->user_email, $photo->_user->user_name);
        }
        if ($this->_dbo->user_id != $session->_uid) {
            $user = new User($session->_uid);
            $to_name = $this->_user->user_login;
            $photo_title = $photo->_dbo->photo_title;
            $author = $user->_dbo->user_login;
            $body = <<<EOT
Witaj {$to_name},

Uytkownik {$author} wyedytowa Tw� komentarz do zdj�ia "{$photo_title}".

Obecna tre�komentarza:

{$title}

{$text}

----

Poprzednia tre�komentarza:

{$o_title}

{$o_text}

-- 
Ten email zosta wysany automatycznie. Prosimy nie odpowiada�
EOT;
            Utils::mail("Tw� komentarz do zdj�ia \"{$photo_title}\" zosta zmieniony.", $body, $this->_user->user_email, $this->_user->user_name);
        }
    }
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:71,代码来源:Comment.php

示例5: sendMessageToCategory

 public function sendMessageToCategory($dest, $sujet, $message, $subscribed_only = false)
 {
     $config = Config::getInstance();
     $headers = ['From' => '"' . $config->get('nom_asso') . '" <' . $config->get('email_asso') . '>'];
     $message .= "\n\n--\n" . $config->get('nom_asso') . "\n" . $config->get('site_asso');
     if ($dest == 0) {
         $where = 'id_categorie NOT IN (SELECT id FROM membres_categories WHERE cacher = 1)';
     } else {
         $where = 'id_categorie = ' . (int) $dest;
     }
     if ($subscribed_only) {
         $where .= ' AND lettre_infos = 1';
     }
     $db = DB::getInstance();
     $res = $db->query('SELECT email FROM membres WHERE LENGTH(email) > 0 AND ' . $where . ' ORDER BY id;');
     $sujet = '[' . $config->get('nom_asso') . '] ' . $sujet;
     while ($row = $res->fetchArray(SQLITE3_ASSOC)) {
         Utils::mail($row['email'], $sujet, $message, $headers);
     }
     return true;
 }
开发者ID:kd2org,项目名称:garradin,代码行数:21,代码来源:Membres.php

示例6: activate

    function activate($r, $login_url)
    {
        $db = Database::singletone()->db();
        if ($this->dbdata('user_activation') != $r) {
            throw new Exception("Błąd aktywacji. Konto nie istnieje.");
        }
        if ($this->dbdata('user_activated') > 0) {
            throw new Exception("Błąd aktywacji. Konto zostało już aktywowane.");
        }
        //$this->_dbo->user_activated = time();
        $sth = $db->prepare("UPDATE phph_users SET user_activated = :user_activated WHERE user_id = :uid");
        $sth->bindValue(":user_activated", time());
        $sth->bindParam(":uid", $this->_uid);
        $sth->execute();
        $this->updateDBData();
        $site_title = Config::get("site_title");
        $user_login = $this->dbdata('user_login');
        $body = <<<EOT
Witaj {$user_login},

Dziękujemy za rejestrację w serwisie "{$site_title}".
Od tej pory możesz zalogować się na swoje konto pod poniższym adresem:
{$login_url}

Pozdrawiamy.

EOT;
        Utils::mail("Dziękujemy za rejestrację w serwisie \"{$site_title}\"", $body, $this->dbdata('user_email'), $this->dbdata('user_name'));
    }
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:29,代码来源:User.php

示例7: addComment

    function addComment($title, $text)
    {
        $session = Session::singletone();
        $dbo = DB_DataObject::Factory("phph_comments");
        if (PEAR::isError($dbo)) {
            throw new Exception2(_INTERNAL_ERROR, $dbo->getMessage());
        }
        $dbo->comment_title = $title;
        $dbo->comment_text = $text;
        $dbo->photo_id = $this->_pid;
        $dbo->comment_date = time();
        $dbo->user_id = $session->_uid;
        $dbo->insert();
        if ($this->_dbo->user_id != $session->_uid) {
            $user = new User($session->_uid);
            $to_name = $this->_user->user_login;
            $photo_title = $this->_dbo->photo_title;
            $author = $user->_dbo->user_login;
            $body = <<<EOT
Witaj {$to_name},

U¿ytkownik {$author} doda³ do Twojego zdjêcia "{$photo_title}" komentarz. Poni¿ej znajduje siê tre¶æ komentarza:

{$title}

{$text}

-- 
Ten email zosta³ wys³any automatycznie. Prosimy nie odpowiadaæ.
EOT;
            Utils::mail("Nowy komentarz do Twojego zdjêcia \"{$photo_title}\".", $body, $this->_user->user_email, $this->_user->user_name);
        }
    }
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:33,代码来源:photo.php

示例8: reject

 function reject($note)
 {
     $session = Session::singletone();
     $db = Database::singletone()->db();
     $sth = $db->prepare('UPDATE phph_photos SET photo_approved = 0 WHERE photo_id = :pid');
     $sth->bindValue(':pid', $this->pid());
     $sth->execute();
     $sth = null;
     $this->updateDBData();
     $this->moderate('reject', $note);
     /*		$subs = array();
     		foreach ($this->_category_objs as $category) {
     			$category->getSubscribers(&$subs);
     		}
     
     		foreach ($subs as $id => $user) {
     			if ($id != $this->_dbo->user_id) {
     				$name = $user['user_login'];
     				$title = $this->_dbo->photo_title;
     				$author = $this->_user->user_login;
     				$link = Config::get("site_url") . "/index.php?action=view&pid=" . $this->_pid;
     
     				$cata = array();
     				foreach ($user['cids'] as $cid => $cat) {
     					$cata[] = $cat['category_name'];
     				}
     				$cats = implode("\n - ", $cata);
     				$txt_body = <<<EOT
     Witaj $name,
     
     W nast�ujcych kategoriach:
      - $cats
     pojawio si�nowe zdj�ie:
     Tytu: $title
     Autor: $author
     $link
     
     --
     Ten email zosta wysany automatycznie.
     Prosimy nie odpowiada�
     EOT;
     				Utils::mail("Nowe zdj�ie w obserwowanych kategoriach.", $txt_body, $user['user_email'], $user['user_name']);
     			}
     		}
     */
     if (Config::get('send-reject-notify', 0)) {
         $search = array('[rcpt_login]', '[photo_title]', '[moderator_login]', '[date]', '[time]', '[datetime]', '[moderator_note]');
         $replace = array($this->author()->dbdata('user_login'), $this->dbdata('photo_title'), $session->user()->dbdata('user_login'), Utils::formatDate(time()), Utils::formatTime(time(), '%T'), Utils::formatTime(time()), $note);
         $txt_body = str_replace($search, $replace, Config::get('reject-notify', ''));
         Utils::mail("Twoje zdjęcie zostało odrzucone.", $txt_body, $this->author()->dbdata('user_email'), $this->author()->dbdata('user_name'));
     }
 }
开发者ID:BackupTheBerlios,项目名称:phphoto-svn,代码行数:52,代码来源:Photo.php

示例9: process_jambo

 /**
  * Process the jambo form and send the email
  */
 function process_jambo($form, $settings)
 {
     // get the values and the stored options.
     $email = array();
     $email['sent'] = false;
     $email['name'] = $form->jambo_name->value;
     $email['send_to'] = $settings['send_to'];
     $email['email'] = $form->jambo_email->value;
     $email['message'] = $form->jambo_message->value;
     $email['success_message'] = $settings['success_message'];
     /*		// interesting stuff, this OSA business. If it's not covered by FormUI, maybe it should be.
     		$email['osa'] =            $this->handler_vars['osa'];
     		$email['osa_time'] =       $this->handler_vars['osa_time'];
     */
     // Develop the email subject
     $email['subject'] = $settings['subject'];
     if (self::ask_subject($email['subject'])) {
         $email['subject'] = sprintf($email['subject'], $form->jambo_subject->value);
     }
     // Utils::mail expects an array
     $email['headers'] = array('MIME-Version' => '1.0', 'From' => "{$email['name']} <{$email['email']}>", 'Content-Type' => 'text/plain; charset="utf-8"');
     $email = Plugins::filter('jambo_email', $email, $form);
     // Allow another plugin to modify the sent email
     $email['sent'] = Utils::mail($email['send_to'], $email['subject'], $email['message'], $email['headers']);
     return '<p class="jambo-confirmation">' . $email['success_message'] . '</p>';
 }
开发者ID:habari-extras,项目名称:jambo,代码行数:29,代码来源:jambo.plugin.php

示例10: submit

 function submit($input)
 {
     $elements = self::elements();
     $headers['MIME-Version'] = '1.0';
     $headers['Content-type'] = 'text/html; charset=iso-8859-1';
     $message = 'You have recieved a submission through your online form. The message follows.<br />';
     foreach ($input as $field => $value) {
         $message .= $elements[$field]['label'] . ': ';
         $message .= $value;
         $message .= '<br />';
     }
     if (Utils::mail(Options::get('aliencontact__email'), Options::get('aliencontact__subject'), $message, $headers) == TRUE) {
         if (self::install()) {
             if (self::insert($input)) {
                 return TRUE;
             } else {
                 return FALSE;
             }
         } else {
             return TRUE;
         }
     } else {
         return FALSE;
     }
 }
开发者ID:habari-extras,项目名称:aliencontact,代码行数:25,代码来源:aliencontact.plugin.php

示例11: sendAuto

 /**
  * Envoi de mail pour rappel automatisé
  * @param  array $data Données du rappel automatisé
  * @return boolean     TRUE
  */
 public function sendAuto($data)
 {
     $replace = $data;
     $replace['date_rappel'] = Utils::sqliteDateToFrench($replace['date_rappel']);
     $replace['date_expiration'] = Utils::sqliteDateToFrench($replace['expiration']);
     $replace['nb_jours'] = abs($replace['nb_jours']);
     $replace['delai'] = abs($replace['delai']);
     $subject = $this->replaceTagsInContent($data['sujet'], $replace);
     $text = $this->replaceTagsInContent($data['texte'], $replace);
     // Envoi du mail
     Utils::mail($data['email'], $subject, $text);
     // Enregistrement en DB
     $this->add(['id_cotisation' => $data['id_cotisation'], 'id_membre' => $data['id'], 'id_rappel' => $data['id_rappel'], 'media' => Rappels_Envoyes::MEDIA_EMAIL, 'date' => $data['date_rappel']]);
     return true;
 }
开发者ID:kd2org,项目名称:garradin,代码行数:20,代码来源:Rappels_Envoyes.php


注:本文中的Utils::mail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。