当前位置: 首页>>代码示例>>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;未经允许,请勿转载。