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


PHP gcms::customMail方法代码示例

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


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

示例1: elseif

        if (gcms::isAdmin()) {
            $sender = $db->getRec(DB_USER, $_POST['email_from']);
        } else {
            $sender = $_SESSION['login'];
        }
        // ตรวจสอบค่าที่ส่งมา
        if ($sender['email'] == '') {
            $ret['error'] = 'ACTION_ERROR';
        } elseif ($reciever == '') {
            $ret['error'] = 'RECIEVER_EMPTY';
            $ret['input'] = 'email_reciever';
        } elseif ($sender == $reciever) {
            $ret['error'] = 'ACTION_ERROR';
        } elseif ($topic == '') {
            $ret['error'] = 'TOPIC_EMPTY';
            $ret['input'] = 'email_subject';
        } elseif ($detail == '') {
            $ret['error'] = 'DETAIL_EMPTY';
        } else {
            $error = gcms::customMail($reciever, "{$sender['email']}<{$sender['displayname']}>", $topic, $detail);
            if ($error == '') {
                $ret['error'] = 'EMAIL_SEND_SUCCESS';
                $ret['location'] = 'back';
            } else {
                $ret['alert'] = rawurlencode($error);
            }
        }
    }
    // คืนค่าเป็น JSON
    echo gcms::array2json($ret);
}
开发者ID:goragod,项目名称:php-framework-benchmark,代码行数:31,代码来源:mailto.php

示例2: sendMail

 /**
  * ฟังก์ชั่นส่งเมล์จากแม่แบบจดหมาย
  *
  * @global resource $db database resource
  * @global array $config ตัวแปรเก็บการตั้งค่าของ GCMS
  * @global int $mmktime เวลาปัจจุบัน (mktime)
  * @param int $id ID ของจดหมายที่ต้องการส่ง
  * @param string $module ชื่อโมดูลของจดหมายที่ต้องการส่ง
  * @param array $datas ข้อมูลที่จะถูกแทนที่ลงในจดหมาย ในรูป 'ตัวแปร'=>'ข้อความ'
  * @param string $to ที่อยู่อีเมล์ผู้รับ  คั่นแต่ละรายชื่อด้วย ,
  * @return string สำเร็จคืนค่าว่าง ไม่สำเร็จ คืนค่าข้อความผิดพลาด
  */
 public static function sendMail($id, $module, $datas, $to)
 {
     global $db, $config, $mmktime;
     $sql = "SELECT * FROM `" . DB_EMAIL_TEMPLATE . "`";
     $sql .= " WHERE `module`='{$module}' AND `email_id`='{$id}' AND `language` IN ('" . LANGUAGE . "','th')";
     $sql .= " LIMIT 1";
     $email = $db->customQuery($sql);
     if (sizeof($email) == 0) {
         return 'Error : email template not found.';
     } else {
         $email = $email[0];
         // ข้อความในอีเมล์
         $replace = array();
         $replace['/%WEBTITLE%/'] = strip_tags($config['web_title']);
         $replace['/%WEBURL%/'] = WEB_URL;
         $replace['/%EMAIL%/'] = $to;
         $replace['/%ADMINEMAIL%/'] = empty($email['from_email']) ? $config['noreply_email'] : $email['from_email'];
         $replace['/%TIME%/'] = gcms::mktime2date($mmktime);
         $replace = array_merge($replace, $datas);
         $patt = array_keys($replace);
         $replace = array_values($replace);
         $msg = preg_replace($patt, $replace, $email['detail']);
         $subject = preg_replace($patt, $replace, $email['subject']);
         // ส่งอีเมล์
         return gcms::customMail($to . (!empty($email['copy_to']) ? ",{$email['copy_to']}" : ''), $email['from_email'], $subject, $msg);
     }
 }
开发者ID:phannack,项目名称:GCMS,代码行数:39,代码来源:class.gcms.php

示例3: elseif

            $ret['error'] = 'ACTION_ERROR';
            $ret['input'] = 'mail_reciever';
        } elseif ($sender == $reciever) {
            $ret['error'] = 'EMAIL_SEND_SELF';
            $ret['input'] = 'mail_sender';
        } elseif ($topic == '') {
            $ret['error'] = 'TOPIC_EMPTY';
            $ret['input'] = 'mail_topic';
        } elseif ($detail == '') {
            $ret['error'] = 'DETAIL_EMPTY';
        } elseif ($_POST['mail_antispam'] != $_SESSION[$_POST['antispam']]) {
            $ret['ret_mail_antispam'] = 'this';
            $ret['input'] = 'mail_antispam';
        } else {
            // ส่งอีเมล์
            $error = gcms::customMail($reciever, $sender, $topic, $detail);
            // clear antispam
            unset($_SESSION['emails']);
            unset($_SESSION[$_POST['antispam']]);
            // คืนค่า
            if ($error == '') {
                $ret['error'] = 'EMAIL_SEND_SUCCESS';
                $ret['location'] = 'back';
            } else {
                $ret['alert'] = rawurlencode($error);
            }
        }
    }
    // คืนค่าเป็น JSON
    echo gcms::array2json($ret);
}
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:sendmail.php

示例4: elseif

         } elseif (!gcms::validMail($sender['email'])) {
             $ret['error'] = 'REGISTER_INVALID_EMAIL';
             $ret['input'] = 'mail_sender';
         } elseif (sizeof($emails) == 0) {
             $ret['error'] = 'EMAIL_RECIEVER_NOT_FOUND';
         } elseif ($topic == '') {
             $ret['error'] = 'TOPIC_EMPTY';
             $ret['input'] = 'mail_topic';
         } elseif ($detail == '') {
             $ret['error'] = 'DETAIL_EMPTY';
         } elseif ($_POST['mail_antispam'] != $_SESSION[$_POST['antispam']]) {
             $ret['ret_mail_antispam'] = 'this';
             $ret['input'] = 'mail_antispam';
         } else {
             // ส่งอีเมล์
             $error = gcms::customMail(implode(',', $emails), "{$sender['email']}<{$sender['displayname']}>", $topic, $detail);
             // clear antispam
             unset($_SESSION['emails']);
             unset($_SESSION[$_POST['antispam']]);
             // คืนค่า
             if ($error == '') {
                 $ret['error'] = 'EMAIL_SEND_SUCCESS';
                 $ret['location'] = 'back';
             } else {
                 $ret['alert'] = rawurlencode($error);
             }
         }
     }
 }
 // คืนค่าเป็น JSON
 echo gcms::array2json($ret);
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:mailto.php


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