當前位置: 首頁>>代碼示例>>PHP>>正文


PHP mailer::setRecipient方法代碼示例

本文整理匯總了PHP中mailer::setRecipient方法的典型用法代碼示例。如果您正苦於以下問題:PHP mailer::setRecipient方法的具體用法?PHP mailer::setRecipient怎麽用?PHP mailer::setRecipient使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mailer的用法示例。


在下文中一共展示了mailer::setRecipient方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * Form to email a member
  *
  * @author Jason Warner <jason@mercuryboard.com>
  * @since RC1
  **/
 function execute()
 {
     $this->set_title($this->lang->email_email);
     $this->tree($this->lang->email_email);
     if (!$this->perms->auth('email_use')) {
         return $this->message($this->lang->email_email, $this->lang->email_no_perm);
     }
     if (!isset($this->post['submit'])) {
         $this->get['to'] = isset($this->get['to']) ? intval($this->get['to']) : '';
         if ($this->get['to']) {
             $target = $this->db->fetch("SELECT user_name FROM {$this->pre}users WHERE user_id={$this->get['to']}");
             if (!isset($target['user_name']) || $this->get['to'] == USER_GUEST_UID) {
                 return $this->message($this->lang->email_email, $this->lang->email_no_member);
             }
             $this->get['to'] = $target['user_name'];
         }
         return eval($this->template('EMAIL_MAIN'));
     } else {
         if (empty($this->post['to']) || empty($this->post['message']) || empty($this->post['subject'])) {
             return $this->message($this->lang->email_email, $this->lang->email_no_fields);
         }
         $target = $this->db->fetch("SELECT user_id, user_email, user_email_form FROM {$this->pre}users WHERE user_name='{$this->post['to']}'");
         if (!$target['user_email_form']) {
             return $this->message($this->lang->email_email, $this->lang->email_blocked);
         }
         if (!isset($target['user_id']) || $target['user_id'] == USER_GUEST_UID) {
             return $this->message($this->lang->email_email, $this->lang->email_no_member);
         }
         include './lib/mailer.php';
         $mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
         $mailer->setSubject("{$this->sets['forum_name']} - {$this->post['subject']}");
         $mailer->setMessage("This mail has been sent by {$this->user['user_name']} via {$this->sets['forum_name']}\n\n" . stripslashes($this->post['message']));
         $mailer->setRecipient($target['user_email']);
         $mailer->setServer($this->sets['mailserver']);
         $mailer->doSend();
         return $this->message($this->lang->email_email, $this->lang->email_sent);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:mercuryb-svn,代碼行數:44,代碼來源:email.php

示例2: mailer

 function send_activation_email($email, $username, $pass, $jointime)
 {
     include './lib/mailer.php';
     $mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
     $message = "{$this->lang->register_email_msg}\n";
     $message .= "{$this->lang->register_email_msg2} {$this->sets['forum_name']}.\n\n";
     $message .= "{$this->lang->register_email_msg3}\n";
     $message .= "{$this->sets['loc_of_board']}{$this->mainfile}?a=register&s=activate&e=" . md5($email . $username . $pass . $jointime);
     $mailer->setSubject("{$this->sets['forum_name']} - {$this->lang->register_activating}");
     $mailer->setMessage($message);
     $mailer->setRecipient($email);
     $mailer->setServer($this->sets['mailserver']);
     $mailer->doSend();
     return $this->message($this->lang->register_reging, sprintf($this->lang->register_must_activate, $email));
 }
開發者ID:BackupTheBerlios,項目名稱:qsf-svn,代碼行數:15,代碼來源:register.php

示例3: mailer

 function request_pass()
 {
     $this->set_title($this->lang->login_pass_reset);
     $this->tree($this->lang->login_pass_reset);
     if (!isset($this->get['e'])) {
         $this->get['e'] = null;
     }
     $target = $this->db->fetch("SELECT user_id, user_name, user_email FROM {$this->pre}users WHERE MD5(CONCAT(user_email, user_name, user_password, user_joined))='" . preg_replace('/[^a-z0-9]/', '', $this->get['e']) . '\' AND user_id != ' . USER_GUEST_UID . ' LIMIT 1');
     if (!isset($target['user_id'])) {
         return $this->message($this->lang->login_pass_reset, $this->lang->login_pass_no_id);
     }
     include './lib/mailer.php';
     $mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
     $newpass = $this->generate_pass(8);
     $message = "{$this->sets['forum_name']}\n\n";
     $message .= "Your password has been reset to:\n{$newpass}\n\n";
     $message .= "{$this->sets['loc_of_board']}{$this->mainfile}?a=login";
     $mailer->setSubject("{$this->sets['forum_name']} - Reset Password");
     $mailer->setMessage($message);
     $mailer->setRecipient($target['user_email']);
     $mailer->setServer($this->sets['mailserver']);
     $mailer->doSend();
     $this->db->query("UPDATE {$this->pre}users SET user_password='" . md5($newpass) . "' WHERE user_id={$target['user_id']}");
     return $this->message($this->lang->login_pass_reset, $this->lang->login_pass_sent);
 }
開發者ID:BackupTheBerlios,項目名稱:qsf-svn,代碼行數:25,代碼來源:login.php

示例4: mailer

 function send_activation_email($email, $username, $pass, $jointime)
 {
     include './lib/mailer.php';
     $mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
     $message = "This is an automated email generated by MercuryBoard, and sent to you in order\n";
     $message .= "for you to activate your account with {$this->sets['forum_name']}.\n\n";
     $message .= "Please click the following link, or paste it in to your web browser:\n";
     $message .= "{$this->sets['loc_of_board']}{$this->self}?a=register&s=activate&e=" . md5($email . $username . $pass . $jointime);
     $mailer->setSubject("{$this->sets['forum_name']} - Activating Your Account");
     $mailer->setMessage($message);
     $mailer->setRecipient($email);
     $mailer->setServer($this->sets['mailserver']);
     $mailer->doSend();
     return $this->message($this->lang->register_reging, sprintf($this->lang->register_must_activate, $email));
 }
開發者ID:BackupTheBerlios,項目名稱:mercuryb-svn,代碼行數:15,代碼來源:register.php


注:本文中的mailer::setRecipient方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。