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


PHP smail函數代碼示例

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


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

示例1: cplang

            $note_msg = cplang('event_join_verify', array("space.php?do=event&id={$event['eventid']}", $event['title'], "cp.php?ac=event&id={$event['eventid']}&op=members&status=0&key={$arr['username']}"));
            $query = $_SGLOBAL['db']->query("SELECT ue.*, sf.* FROM " . tname("userevent") . " ue LEFT JOIN " . tname("spacefield") . " sf ON ue.uid=sf.uid WHERE ue.eventid='{$eventid}' AND ue.status >= 3");
            while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $value['privacy'] = empty($value['privacy']) ? array() : unserialize($value['privacy']);
                $filter = empty($value['privacy']['filter_note']) ? array() : array_keys($value['privacy']['filter_note']);
                if (cknote_uid(array("type" => "eventmember", "authorid" => $_SGLOBAL['supe_uid']), $filter)) {
                    $note_ids[] = $value['uid'];
                    $note_inserts[] = "('{$value['uid']}', 'eventmember', '1', '{$_SGLOBAL['supe_uid']}', '{$_SGLOBAL['supe_username']}', '" . addslashes($note_msg) . "', '{$_SGLOBAL['timestamp']}')";
                }
            }
            if ($note_inserts) {
                $_SGLOBAL['db']->query("INSERT INTO " . tname('notification') . " (`uid`, `type`, `new`, `authorid`, `author`, `note`, `dateline`) VALUES " . implode(',', $note_inserts));
                $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET notenum=notenum+1 WHERE uid IN (" . simplode($note_ids) . ")");
            }
            //E-mail notice
            smail($event['uid'], '', $note_msg, 'event');
        }
        // Bonus Points
        getreward('joinevent', 1, 0, $eventid);
        //Statistics
        updatestat('eventjoin');
        //Process Event Invites
        if ($eventinvite) {
            $_SGLOBAL['db']->query("DELETE FROM " . tname("eventinvite") . " WHERE eventid='{$eventid}' AND touid='{$_SGLOBAL['supe_uid']}'");
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET eventinvitenum=eventinvitenum-1 WHERE uid = '{$_SGLOBAL['supe_uid']}' AND eventinvitenum>0");
        }
        showmessage("do_success", "space.php?do=event&id={$eventid}", 0);
        // Join the event successfully
    }
} elseif ($op == "quit") {
    // Quit Event
開發者ID:v998,項目名稱:discuzx-en,代碼行數:31,代碼來源:cp_event.php

示例2: uc_pm_send

             if ($value) {
                 $newusers[] = $value;
             }
         }
         if ($newusers) {
             $return = uc_pm_send($_SGLOBAL['supe_uid'], implode(',', $newusers), $subject, $message, 1, $pmid, 1);
         }
         //發送郵件通知
         $touid = 0;
         if ($return > 0) {
             $query = $_SGLOBAL['db']->query('SELECT uid FROM ' . tname('space') . ' WHERE username IN (' . simplode($users) . ')');
             while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                 if (empty($touid)) {
                     $touid = $value['uid'];
                 }
                 smail($value['uid'], '', cplang('friend_pm', array($_SN[$space['uid']], getsiteurl() . 'space.php?do=pm')), '', 'friend_pm');
             }
         }
     }
     if ($return > 0) {
         //更新最後發布時間
         $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET lastpost='{$_SGLOBAL['timestamp']}' WHERE uid='{$_SGLOBAL['supe_uid']}'");
         showmessage('do_success', "space.php?do=pm&filter=privatepm");
     } else {
         if (in_array($return, array(-1, -2, -3, -4))) {
             showmessage('message_can_not_send' . abs($return));
         } else {
             showmessage('message_can_not_send');
         }
     }
 }
開發者ID:NaturalWill,項目名稱:UCQA,代碼行數:31,代碼來源:cp_pm.php

示例3: showmessage

    $spaceinfo = $_SGLOBAL['db']->fetch_array($query);
    if (empty($spaceinfo)) {
        showmessage('該郵箱賬號沒有在本站注冊!');
    }
    //創始人、管理員不允許找回密碼
    $founderarr = explode(',', $_SC['founder']);
    if ($spaceinfo['flag'] || in_array($spaceinfo['uid'], $founderarr) || checkperm('admin')) {
        showmessage('getpasswd_account_invalid');
    }
    $idstring = random(6);
    $reseturl = getsiteurl() . 'do.php?ac=lostpasswd&op=reset&uid=' . $spaceinfo['uid'] . '&id=' . $idstring;
    updatetable('spacefield', array('authstr' => $_SGLOBAL['timestamp'] . "\t1\t" . $idstring), array('uid' => $spaceinfo['uid']));
    $mail_subject = cplang('get_passwd_subject');
    $mail_message = cplang('get_passwd_message', array($reseturl));
    include_once S_ROOT . './source/function_cp.php';
    smail(0, $spaceinfo['email'], $mail_subject, $mail_message);
    showmessage('getpasswd_send_succeed', 'do.php?ac=' . $_SCONFIG['login_action'], 3);
    //showmessage($reseturl, 'do.php?ac='.$_SCONFIG['login_action'], 3);
} elseif (submitcheck('resetsubmit')) {
    $uid = empty($_POST['uid']) ? 0 : intval($_POST['uid']);
    $id = empty($_POST['id']) ? 0 : trim($_POST['id']);
    if ($_POST['newpasswd1'] != $_POST['newpasswd2']) {
        showmessage('password_inconsistency');
    }
    if ($_POST['newpasswd1'] != addslashes($_POST['newpasswd1'])) {
        showmessage('profile_passwd_illegal');
    }
    $query = $_SGLOBAL['db']->query('SELECT s.uid, s.username, s.groupid, s.flag, sf.email, sf.authstr FROM ' . tname('space') . ' s, ' . tname('spacefield') . " sf WHERE s.uid='{$uid}' AND sf.uid=s.uid");
    $space = $_SGLOBAL['db']->fetch_array($query);
    checkuser($id, $space);
    //驗證是否受保護、創始人、有站點設置權限的人禁止找回密碼方式修改密碼
開發者ID:shiyake,項目名稱:php-ihome,代碼行數:31,代碼來源:do_lostpasswd.php

示例4: cplang

             $n_url = "space.php?uid={$tospace['uid']}&do=poll&pid={$id}&cid={$cid}";
             $note_type = 'pollcomment';
             $q_note = cplang('note_poll_comment_reply', array($n_url));
             $q_msgtype = 'poll_comment_reply';
             break;
         case 'eventid':
             // 活動
             $n_url = "space.php?do=event&id={$id}&view=comment&cid={$cid}";
             $note_type = 'eventcomment';
             $q_note = cplang('note_event_comment_reply', array($n_url));
             $q_msgtype = 'event_comment_reply';
             break;
     }
     if ($comment['authorid'] != $_SGLOBAL['supe_uid']) {
         //發送郵件通知
         smail($comment['authorid'], '', cplang($q_msgtype, array($_SN[$userid], shtmlspecialchars(getsiteurl() . $n_url))), '', $q_msgtype);
         notification_add($comment['authorid'], $note_type, $q_note);
     }
     //通知被@的用戶
     if ($UserIds) {
         $note = cplang('note_comment_at', array($n_url));
         foreach ($UserIds as $UserId) {
             notification_add($UserId, 'atyou', $note);
         }
     }
 }
 //統計
 if ($stattype) {
     updatestat($stattype);
 }
 if ($cid) {
開發者ID:shiyake,項目名稱:php-ihome,代碼行數:31,代碼來源:do_addreplyreply.php

示例5: smail

<?php

echo "<strong>COMP344 Assignment 1, 2012 by Ali Alavi - #40876144</strong><br><br>";
//'smail' is a function for sending email using information gathered from a html form
function smail()
{
    //assign form values to variables
    $email = $_POST["email"];
    $name = $_POST["fname"];
    $subject = "Online bookstore registration";
    $message = "Hello {$name}! Please fallow these steps to complete registration.";
    $from = "admin@mqbookstore.com";
    $headers = "From:" . $from;
    //if statement to check mail function works, else returns error message.
    if (mail($email, $subject, $message, $headers)) {
        print "Thank you for registering for the bookstore, <i>{$name}</i>. Please check your email address(<i>{$email}</i>) for instruction to complete registration.";
    } else {
        echo "Unable to send email.";
    }
}
//execute function
smail();
?>

開發者ID:Emadbox,項目名稱:eStore,代碼行數:23,代碼來源:complete_reg.php

示例6: sprintf

 $title .= $t;
 if (isset($_GET['pid']) && intval($_GET['pid']) > 0 && $menua[$mid][0] != 5) {
     if ($c_log && $pa > 0) {
         $s_dbu = sprintf('select id, name, email from %s where id=%s and status=1 limit 1', $dbprefix . 'member', SQLString($_GET['pid'], 'int'));
         $q_dbu = mysql_query($s_dbu) or die('');
         $r_dbu = mysql_fetch_assoc($q_dbu);
         if (mysql_num_rows($q_dbu) > 0) {
             $u_db = sprintf('update %s set status=0 where id=%s', $dbprefix . 'member', $r_dbu['id']);
             $result = mysql_query($u_db) or die('');
             setsinfo($r_dbu['name'] . ' 通過審核', $r_dbu['id']);
             if ($config['email'] != 1 && $r_dbu['email'] != '') {
                 $mail_c = '親愛的' . $r_dbu['name'] . ":\r\n您在 " . $config['title'] . " 的注冊信息已通過審核,請點擊下麵的地址訪問:\r\n\r\n" . $config['site_url'] . "\r\n\r\n感謝您的注冊,祝您使用愉快!\r\n\r\n此致,\r\n" . $config['title'] . "\r\n";
                 if ($config['email'] == 2) {
                     require_once 'lib/smtp.php';
                 }
                 smail($r_dbu['email'], '[' . $config['title'] . ']您的注冊已通過審核', $mail_c);
             }
         }
         mysql_free_result($q_dbu);
     }
     header('Location:./?m=user' . (isset($_GET['p']) && $_GET['p'] == 1 ? '&id=' . intval($_GET['pid']) : ''));
     exit;
 }
 if (isset($_GET['cid']) && intval($_GET['cid']) > 0 && $menua[$mid][0] != 5) {
     if ($c_log && $pa == 9) {
         $s_dbu = sprintf('select id, name from %s where id=%s and status=0 limit 1', $dbprefix . 'member', SQLString($_GET['cid'], 'int'));
         $q_dbu = mysql_query($s_dbu) or die('');
         $r_dbu = mysql_fetch_assoc($q_dbu);
         if (mysql_num_rows($q_dbu) > 0) {
             $c = $r_dbu['name'] . ' 被設置為';
             if (isset($_GET['p']) && $_GET['p'] == 1) {
開發者ID:lyhiving,項目名稱:mini_class,代碼行數:31,代碼來源:user.php

示例7: createmail

function createmail($mail, $mailvar)
{
    global $_SGLOBAL, $_SCONFIG, $space, $_SN, $appinfo;
    $mailvar[3] = empty($_POST['saymsg']) ? '' : getstr($_POST['saymsg'], 500);
    smail(0, $mail, cplang($appinfo ? 'app_invite_subject' : 'invite_subject', array($_SN[$space['uid']], $_SCONFIG['sitename'], $appinfo['appname'])), cplang($appinfo ? 'app_invite_massage' : 'invite_massage', $mailvar));
}
開發者ID:AlexChien,項目名稱:ey_uhome,代碼行數:6,代碼來源:cp_invite.php

示例8: elseif

} elseif (submitcheck('sendemailsubmit')) {
    if (!$managespacenote) {
        cpmessage('no_authority_management_operation');
    }
    $touids = empty($_POST['uids']) ? array() : explode(',', $_POST['uids']);
    $subject = trim($_POST['subject']);
    $message = trim($_POST['message']);
    if (empty($subject) && empty($message)) {
        $touids = array();
    }
    if ($touids) {
        include_once S_ROOT . './source/function_cp.php';
        $query = $_SGLOBAL['db']->query("SELECT email, emailcheck FROM " . tname('spacefield') . " WHERE uid IN (" . simplode($touids) . ")");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            if ($value['email']) {
                smail(0, $value['email'], $subject, $message);
            }
        }
    }
    cpmessage('do_success', "admincp.php?ac={$ac}&perpage={$_GET['perpage']}&page={$_GET['page']}");
} elseif (submitcheck('pokesubmit')) {
    if (!$managespacenote) {
        cpmessage('no_authority_management_operation');
    }
    //打招呼
    $touids = empty($_POST['uids']) ? array() : explode(',', $_POST['uids']);
    $note = getstr($_POST['note'], 50, 1, 1);
    $uids = array();
    if ($touids) {
        $replaces = array();
        foreach ($touids as $touid) {
開發者ID:NaturalWill,項目名稱:UCQA,代碼行數:31,代碼來源:admincp_space.php

示例9: showmessage

    //打招呼
    if (submitcheck('pokesubmit')) {
        if (empty($tospace)) {
            showmessage('space_does_not_exist');
        }
        $oldpoke = getcount('poke', array('uid' => $uid, 'fromuid' => $_SGLOBAL['supe_uid']));
        $setarr = array('uid' => $uid, 'fromuid' => $_SGLOBAL['supe_uid'], 'fromusername' => $_SGLOBAL['supe_username'], 'note' => getstr($_POST['note'], 50, 1, 1), 'dateline' => $_SGLOBAL['timestamp'], 'iconid' => intval($_POST['iconid']));
        inserttable('poke', $setarr, 0, true);
        //更新統計
        if (!$oldpoke) {
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET pokenum=pokenum+1 WHERE uid='{$uid}'");
        }
        //更新我的好友關係熱度
        addfriendnum($tospace['uid'], $tospace['username']);
        //發送郵件通知
        smail($uid, '', cplang('poke_subject', array($_SN[$space['uid']], getsiteurl() . 'cp.php?ac=poke')), '', 'poke');
        if ($op == 'reply') {
            //刪除招呼
            $_SGLOBAL['db']->query("DELETE FROM " . tname('poke') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND fromuid='{$uid}'");
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET pokenum=pokenum-1 WHERE uid='{$_SGLOBAL['supe_uid']}' AND pokenum>0");
        }
        //獎勵
        getreward('poke', 1, 0, $uid);
        //統計
        updatestat('poke');
        showmessage('poke_success', $_POST['refer'], 1, array($_SN[$tospace['uid']]));
    }
} elseif ($op == 'ignore') {
    $where = empty($uid) ? '' : "AND fromuid='{$uid}'";
    $_SGLOBAL['db']->query("DELETE FROM " . tname('poke') . " WHERE uid='{$_SGLOBAL['supe_uid']}' {$where}");
    //統計更新
開發者ID:NaturalWill,項目名稱:UCQA,代碼行數:31,代碼來源:cp_poke.php

示例10: array_push

            array_push($order, $res['PRODUCTNAME']);
            //$order .= $res['PRODUCTNAME'];
            echo "";
        }
    }
    //Send email regarding order
    function smail($order)
    {
        //assign form values to variables
        $email = $_SESSION['email'];
        //ordered items
        $subject = "Order confirmation";
        $message = "Hello! Your order has been recieved for {$order}. We will notify you after dispatch. Thank you for your purchase. \nFrom: Ali Alavi - #40876144";
        $from = "admin@mqbookstore.com";
        $headers = "From:" . $from;
        //if statement to check mail function works, else returns error message.
        if (mail($email, $subject, $message, $headers)) {
            print "You ordered: {$order}.\nYour order is being processed. An email confirmation has been sent to, {$email}.";
            echo '<br><a href="main.php">Return to shop.</a><br>';
            //clear cart
            unset($_SESSION['cart']);
        } else {
            echo "Unable to send email.<br>";
        }
    }
    $order = implode(", ", $order);
    //call send email function
    smail($order);
} else {
    echo 'Not logged in.<br><a href="login.html">Login to view page</a></br>';
}
開發者ID:Emadbox,項目名稱:eStore,代碼行數:31,代碼來源:checkout.php

示例11: createmail

function createmail($mail, $mailvar)
{
    global $_SGLOBAL, $_SCONFIG, $space, $_SN, $appinfo;
    smail(0, $mail, cplang($appinfo ? 'app_invite_subject' : 'invite_subject', array($_SN[$space['uid']], $_SCONFIG['sitename'], $appinfo['appname'])), cplang($appinfo ? 'app_invite_massage' : 'invite_massage', $mailvar));
}
開發者ID:shiyake,項目名稱:php-ihome,代碼行數:5,代碼來源:cp_invite.php

示例12: showmessage

    }
    //驗證密碼
    if ($_POST['email'] != $space['email']) {
        if (!($passport = getpassport($_SGLOBAL['supe_username'], $_POST['password']))) {
            showmessage('password_is_not_passed');
        }
        //更新資料
        $space['email'] = $_POST['email'];
        updatetable('spacefield', array('email' => $_POST['email'], 'emailcheck' => 0), array('uid' => $space['uid']));
    }
    $mailhash = md5($space['email'] . '|' . md5($_SCONFIG['sitekey']) . '|' . $space['uid']);
    $siteurl = getsiteurl();
    $checkurl = $siteurl . 'cp.php?ac=sendmail&amp;op=check&amp;hash=' . $mailhash;
    $mailsubject = cplang('active_email_subject');
    $mailmessage = cplang('active_email_msg', array($checkurl));
    smail(0, $space['email'], $mailsubject, $mailmessage);
    showmessage('email_check_send');
} elseif (submitcheck('pwdsubmit')) {
    if ($_POST['newpasswd1'] != $_POST['newpasswd2']) {
        showmessage('password_inconsistency');
    }
    if ($_POST['newpasswd1'] != addslashes($_POST['newpasswd1'])) {
        showmessage('profile_passwd_illegal');
    }
    @(include_once S_ROOT . './uc_client/client.php');
    $ucresult = uc_user_edit($_SGLOBAL['supe_username'], $_POST['password'], $_POST['newpasswd1'], $space['email']);
    if ($ucresult == -1) {
        showmessage('old_password_invalid');
    } elseif ($ucresult == -4) {
        showmessage('email_format_is_wrong');
    } elseif ($ucresult == -5) {
開發者ID:xiaoxiaoleo,項目名稱:ngintek,代碼行數:31,代碼來源:cp_password.php

示例13: cplang

         $msgtype = 'blog_comment';
         break;
     case 'sid':
         //分享
         $n_url = "space.php?uid={$tospace['uid']}&do=share&id={$id}&cid={$cid}";
         $note_type = 'sharecomment';
         $note = cplang('note_share_comment', array($n_url));
         $q_note = cplang('note_share_comment_reply', array($n_url));
         $msg = 'do_success';
         $magvalues = array();
         $msgtype = 'share_comment';
         break;
 }
 //發送郵件通知
 $touid = empty($comment['authorid']) ? $tospace['uid'] : $comment['authorid'];
 smail($touid, '', cplang($msgtype, array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . $n_url))));
 if (empty($comment)) {
     //非引用評論
     if ($tospace['uid'] != $_SGLOBAL['supe_uid']) {
         //事件發布
         if (ckprivacy('comment', 1)) {
             feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
         }
         //發送通知
         notification_add($tospace['uid'], $note_type, $note);
         //留言發送短消息
         if ($_POST['idtype'] == 'uid' && $tospace['updatetime'] == $tospace['dateline']) {
             include_once S_ROOT . './uc_client/client.php';
             uc_pm_send($_SGLOBAL['supe_uid'], $tospace['uid'], cplang('wall_pm_subject'), cplang('wall_pm_message', array(addslashes(getsiteurl() . $n_url))), 1, 0, 0);
         }
     }
開發者ID:xiaoxiaoleo,項目名稱:ngintek,代碼行數:31,代碼來源:cp_comment.php

示例14: getfriendstatus

 //檢測相互是否請求過好友,0為單向,1為互為好友,-1為不存在;當前用戶對目標用戶的好友關係;
 $rfstatus = getfriendstatus($touserid, $userid);
 //檢測相互是否請求過好友,0為單向,1為互為好友,-1為不存在;目標用戶對當前用戶的好友關係;
 $type = $_POST['type'];
 //$type="ignore";
 if ($type == 'add') {
     if ($fstatus == 1) {
         $result = array('flag' => 'isfriends');
     } else {
         if ($rfstatus == -1) {
             //對方沒有加好友,我加別人
             if ($fstatus == -1) {
                 $setarr = array('uid' => $userid, 'fuid' => $touserid, 'fusername' => $tousername, 'gid' => 0, 'dateline' => time());
                 inserttable('friend', $setarr);
                 //發送郵件通知
                 smail($touserid, '', cplang('friend_subject', array($space['name'], getsiteurl() . 'cp.php?ac=friend&amp;op=request')), '', 'friend_add');
                 //增加對方好友申請數
                 $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET addfriendnum=addfriendnum+1 WHERE uid='{$touserid}'");
                 $result = array('flag' => 'issending');
             } else {
                 $result = array('flag' => 'hassended');
             }
         } else {
             //對方加了我為好友,我審核通過
             friend_update($userid, $space['username'], $touserid, $tousername, 'add', 0);
             //事件發布
             //加好友不發布事件
             if (ckprivacy('friend', 1)) {
                 $fs = array();
                 $fs['icon'] = 'friend';
                 $fs['title_template'] = cplang('feed_friend_title');
開發者ID:shiyake,項目名稱:php-ihome,代碼行數:31,代碼來源:do_cpfriend.php

示例15: getfriendstatus

 }
 //對方是否把自己加為了好友
 $fstatus = getfriendstatus($uid, $_SGLOBAL['supe_uid']);
 if ($fstatus == -1) {
     //對方沒有加好友,我加別人
     if ($status == -1) {
         //視頻認證
         if ($tospace['videostatus']) {
             ckvideophoto('friend', $tospace);
         }
         //添加單向好友
         if (submitcheck('addsubmit')) {
             $setarr = array('uid' => $_SGLOBAL['supe_uid'], 'fuid' => $uid, 'fusername' => addslashes($tospace['username']), 'gid' => intval($_POST['gid']), 'note' => getstr($_POST['note'], 50, 1, 1), 'dateline' => $_SGLOBAL['timestamp']);
             inserttable('friend', $setarr);
             //發送郵件通知
             smail($uid, '', cplang('friend_subject', array($_SN[$space['uid']], getsiteurl() . 'cp.php?ac=friend&amp;op=request')), '', 'friend_add');
             //增加對方好友申請數
             $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET addfriendnum=addfriendnum+1 WHERE uid='{$uid}'");
             showmessage('request_has_been_sent');
         } else {
             include_once template('cp_friend');
             exit;
         }
     } else {
         showmessage('waiting_for_the_other_test');
     }
 } else {
     //對方加了我為好友,我審核通過
     if (submitcheck('add2submit')) {
         //成為好友
         $gid = intval($_POST['gid']);
開發者ID:NaturalWill,項目名稱:UCQA,代碼行數:31,代碼來源:cp_friend.php


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