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


PHP mail類代碼示例

本文整理匯總了PHP中mail的典型用法代碼示例。如果您正苦於以下問題:PHP mail類的具體用法?PHP mail怎麽用?PHP mail使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: passwordForget

 function passwordForget($opt)
 {
     // PUEDEN EXISTIR 3 ESTADOS A LA OPERACION (status)
     // 0: OPERACION EXITOSA
     // 1: EL USUARIO YA EXISTE
     // 2: EXISTIO UN ERROR AL CREARLO POR DB
     // 3: NO SE PUDO ENVIAR EL EMAIL
     $dbo = $this->db;
     if ($dbo->isExists('users', 'email', $opt->email)) {
         $where['email'] = $opt->email;
         $matriz['opeToken'] = $this->getToken('users', 'opeToken');
         if ($dbo->update('users', $matriz, $where)) {
             $email = new mail();
             if ($email->sendForgotMail($opt->email, $matriz['opeToken'])) {
                 $this->returnData(array("status" => 0));
             } else {
                 $this->returnData(array("status" => 3));
             }
         } else {
             $this->returnData(array("status" => 2));
         }
     } else {
         $this->returnData(array("status" => 1));
     }
 }
開發者ID:centaurustech,項目名稱:eollice,代碼行數:25,代碼來源:users.php

示例2: testEmail

 function testEmail()
 {
     $email = new mail();
     if ($email->send($_POST['email'], '測試用戶', '這是一封測試郵件!', '這是一封測試郵件!你看到此郵件,說明你的郵箱已經配置好了。歡迎來到' . '<a href="' . __WEB__ . '">' . C('WEB_NAME') . '</a><br /><a href="http://www.houdunwang.com"><img src="http://bbs.houdunwang.com/static/image/common/logo.png" alt="後盾PHP培訓" /></a>')) {
         $this->success('郵件發送成功');
     }
     $this->success('郵件發送失敗');
 }
開發者ID:com-itzcy,項目名稱:hdjob,代碼行數:8,代碼來源:webConfigControl.php

示例3: executeQuery

 function executeQuery($query)
 {
     $result = mysql_query($query, $this->handler);
     if (!$result) {
         $mail = new mail();
         $error = mysql_error();
         $mail->send_error_mail($query, $error);
     }
     return $result;
 }
開發者ID:sakkeerhussain,項目名稱:online_ims,代碼行數:10,代碼來源:DBConnection.php

示例4: send

 function send($email, $code)
 {
     $sendmail = new sendmail();
     $mail = new mail();
     $mail->setSmtpemailto($email);
     $mail->setMailsubject("郵箱驗證");
     $mail->setMailbody("感謝你的支持,你的驗證碼為:" . $code);
     $rs = $sendmail->send($mail);
     return $rs;
 }
開發者ID:Zocoo,項目名稱:zune,代碼行數:10,代碼來源:email.php

示例5: unsubscribe

 public function unsubscribe()
 {
     $mail_configs['appid'] = $this->appid;
     $mail_configs['appkey'] = $this->appkey;
     if ($this->sign_type != '') {
         $mail_configs['sign_type'] = $this->sign_type;
     }
     $addressbook = new mail($mail_configs);
     return $addressbook->unsubscribe($this->buildRequest());
 }
開發者ID:xueron,項目名稱:SUBMAIL_PHP_SDK,代碼行數:10,代碼來源:addressbookmail.php

示例6: execute

 public function execute($function)
 {
     if (is_callable(array($this, $function))) {
         try {
             $this->{$function}();
         } catch (Error_Cron $e) {
             $mail = new mail(def::notify('mail'));
             $mail->text(serialize($e))->send();
         }
     }
 }
開發者ID:4otaku,項目名稱:4otaku,代碼行數:11,代碼來源:abstract.php

示例7: shutdown_handler

 function shutdown_handler()
 {
     $error = error_get_last();
     if ($error && ($error['type'] == E_ERROR || $error['type'] == E_PARSE || $error['type'] == E_COMPILE_ERROR)) {
         if (strpos($error['message'], 'Allowed memory size') === 0) {
             ob_end_clean();
             $mail = new mail(def::notify('mail'));
             $mail->text(serialize(query::$url) . serialize($error))->send();
         } else {
             ob_end_clean();
             $mail = new mail(def::notify('mail'));
             $mail->text(serialize(query::$url) . serialize($error))->send();
         }
     }
 }
開發者ID:4otaku,項目名稱:4otaku,代碼行數:15,代碼來源:functions.php

示例8: do_edit

 /**
  * 回複留言信息
  */
 function do_edit($id)
 {
     //權限檢查 得到所有可管理站點ID列表
     role::check('contact_us_manage');
     if (!$id) {
         remind::set(Kohana::lang('o_global.bad_request'), 'user/contact_us');
     }
     if ($_POST) {
         //獲取留言信息,發郵件
         $contact_us = Mycontact_us::instance($id)->get();
         $email_flag = 'contact_us';
         $title_param = array();
         $content_param = array();
         $content_param['{message}'] = strip_tags($_POST['return_message']);
         if (mail::send_mail($email_flag, $contact_us['email'], $from_email = '', $title_param, $content_param)) {
             $is_receive = 1;
             remind::set(Kohana::lang('o_global.mail_send_success'), '', 'success');
         } else {
             $is_receive = 0;
             remind::set(Kohana::lang('o_global.mail_send_error'), '', 'error');
         }
         $data = $_POST;
         $data['active'] = 0;
         $data['is_receive'] = $is_receive;
         if (Mycontact_us::instance($id)->edit($data)) {
             remind::set(Kohana::lang('o_user.message_handle_success'), request::referrer(), 'success');
         } else {
             remind::set(Kohana::lang('o_user.message_handle_error'), request::referrer(), 'error');
         }
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:34,代碼來源:contact_us.php

示例9: send

 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);
 }
開發者ID:RH-Code,項目名稱:opencaching,代碼行數:34,代碼來源:mail.class.php

示例10: update

 public static function update($argv)
 {
     global $_cache, $_user, $_db;
     $result = 'succeed';
     if (!$_user->user_id) {
         return false;
     }
     if ($argv['password'] != '') {
         if ($argv['repeat_password'] == '' || $argv['password'] != $argv['repeat_password']) {
             return false;
         }
     }
     session_start();
     $cache_key = md5("activate_{$_user->user_id}");
     $email = filter_var($argv['email'], FILTER_VALIDATE_EMAIL);
     unset($argv['email']);
     if ($email && $email != $_user->email && !isset($_SESSION['activate'][$cache_key])) {
         //ÓÊÏäÒÑ´æÔÚ
         if (self::get_one(array('email' => $email))) {
             return 'email_exist';
         }
         mail::send_activate($email, $cache_key);
         //		$_cache->add($cache_key,$user->user_id.'_'.$email);
         $_SESSION['activate'][$cache_key] = $_user->user_id . '_' . $email;
         $result = 'email';
     }
     $argv = array_intersect_key($argv, self::$default_value);
     if (!empty($argv)) {
         $_db->update('users', $argv, array('user_id' => $_user->user_id));
         $_cache->delete("user_{$user->user_id}");
     }
     return $result;
 }
開發者ID:questionlin,項目名稱:pickcat,代碼行數:33,代碼來源:user.class.php

示例11: callback_demo

/**
 * 模型id.php 內容模型或表單模型回調處理函數(需要一定的開發基礎)
 *
 * 這是一個示例文件
 *
 * 函數格式:function callback_模型表名稱($data) {}
 * $data 就是表單的提交內容了
 */
function callback_demo($data)
{
    // 由開發者二次開發
    // 用於發送郵件
    mail::set(App::$config);
    mail::sendmail('收件人地址', '發信標題', '發信內容');
}
開發者ID:rainbow88,項目名稱:hummel,代碼行數:15,代碼來源:demo.php

示例12: validURLCheck

/**
 * Prueft die URL damit keine boesen URLS uebergeben werden koennen
 * @param $param
 */
function validURLCheck($param)
{
    if (strstr($param, '://')) {
        // Der APP_ROOT muss in der URL vorkommen, sonfern es kein relativer Pfad ist
        // HTTPS und HTTP
        if (mb_strpos($param, APP_ROOT) !== 0 && mb_strpos(mb_str_replace("http://", "https://", $param), APP_ROOT) !== 0 && mb_strpos(mb_str_replace("https://", "http://", $param), APP_ROOT) !== 0) {
            $text = "Dies ist eine automatische Mail.\nEs wurde eine mögliche XSS Attacke durchgefuehrt:\n";
            $text .= "\nFolgende URL wurde versucht aufzurufen: \n" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
            $text .= "\n\nIP des Aufrufers: " . $_SERVER['REMOTE_ADDR'];
            $text .= "\n\nUserAgent: " . $_SERVER['HTTP_USER_AGENT'];
            $text .= "\n\nAuffälliger Value: {$param}";
            $mail = new mail(MAIL_ADMIN, 'no-reply@' . DOMAIN, 'Versuchte XSS Attacke', $text);
            $mail->send();
            die('Invalid URL detected');
        }
    }
}
開發者ID:andikoller,項目名稱:FHC-3.0-FHBGLD,代碼行數:21,代碼來源:index.php

示例13: create

 public static function create($data)
 {
     $user = ORM::factory('User');
     $user->create_user($data, array('username', 'password', 'email'));
     $user->add_role('login');
     $mail = mail::create('usercreated')->to($user->email)->tokenize(array('username' => $user->username))->send();
     user::login(arr::get($data, 'email', ''), arr::get($data, 'password', ''));
 }
開發者ID:artbypravesh,項目名稱:morningpages,代碼行數:8,代碼來源:user.php

示例14: compra

 public static function compra($data)
 {
     //     dd($data);
     mail::send('correos.compra', $data, function ($messages) use($data) {
         $messages->from(env('MAIL_USERNAME'), env('MAIL_NAME'));
         $messages->subject(' 🏆 ¡Felicitaciones! Gracias por su Compra ...');
         $messages->to($data["correo"]);
     });
 }
開發者ID:jlobaton,項目名稱:inventario,代碼行數:9,代碼來源:MailController.php

示例15: ajax_template

 /**
  * ajax get mail template by type
  */
 public function ajax_template($type)
 {
     $mail = mail::content($type);
     $this->template = new View('template_blank');
     if (isset($mail['content_result'])) {
         $this->template->content = $mail['content_result'];
     } else {
         $this->template->content = 'Hacking attempt';
     }
 }
開發者ID:RenzcPHP,項目名稱:3dproduct,代碼行數:13,代碼來源:mail.php


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