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


PHP sendemail函数代码示例

本文整理汇总了PHP中sendemail函数的典型用法代码示例。如果您正苦于以下问题:PHP sendemail函数的具体用法?PHP sendemail怎么用?PHP sendemail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: sendEmail

 function sendEmail()
 {
     global $pref;
     require_once e_HANDLER . "mail.php";
     $message = "Your Cron Job worked correctly. Sent at " . date("r") . ".";
     sendemail($pref['siteadminemail'], "e107 - TEST Email Sent by cron." . date("r"), $message, $pref['siteadmin'], $pref['siteadminemail'], $pref['siteadmin']);
 }
开发者ID:notzen,项目名称:e107,代码行数:7,代码来源:e_cron.php

示例2: activeuser_general

function activeuser_general($body_arr)
{
    $contact = $body_arr['contact'];
    $callback = $body_arr['callback'];
    $userid = $body_arr['realuserid'];
    $body_arr['type'] = 1;
    //生成验证码
    $resp_general_arr = exec_procedure($body_arr, 'p_general_code');
    extract($resp_general_arr);
    if ($status != 0) {
        die_err_code($status, __LINE__);
    }
    $data0 = $resp_general_arr['data'][0];
    extract($data0);
    $code = isset($data0['code']) ? $data0['code'] : '';
    $deadminutes = isset($data0['deadminutes']) ? $data0['deadminutes'] : '';
    //发送邮件
    if ($deadminutes % 60 == 0) {
        $timeinfo = $deadminutes / 60 . '小时';
    } else {
        $timeinfo = $deadminutes . '分钟';
    }
    $httpmsg = "亲爱的用户,您好!<br/>您正在执行注册操作,请在" . $timeinfo . "内点击下面的链接完成您的邮箱验证:<br/>" . '<a href="' . (_MAILCALLBACK_ . $callback) . '?mark=' . $code . '&email=' . $contact . '&userid=' . $userid . '" target="_blank">' . (_MAILCALLBACK_ . $callback) . "mark=" . $code . '&email=' . $contact . '&userid=' . $userid . "</a>" . "<br>如果以上链接无法点击,请将上面的地址复制到您的浏览器(如IE)的地址栏打开。<br>" . ($data['subject'] = '注册');
    $data['fromname'] = '骑士团';
    $data['to'] = $body_arr['contact'];
    $data['body'] = $httpmsg;
    $data['img'] = '';
    //绑定邮箱,没有附加图片
    $data['attach'] = '';
    //绑定邮箱,没有附件
    sendemail($data);
    return $resp_general_arr;
}
开发者ID:yonglinchen,项目名称:shopping,代码行数:33,代码来源:activeuser.php

示例3: flood_control

function flood_control($field, $table, $where)
{
    global $userdata, $settings, $locale;
    $flood = false;
    if (!iSUPERADMIN && !iADMIN && (!defined("iMOD") || !iMOD)) {
        $result = dbquery("SELECT MAX(" . $field . ") AS last_post FROM " . $table . " WHERE " . $where);
        if (dbrows($result)) {
            $data = dbarray($result);
            if (time() - $data['last_post'] < $settings['flood_interval']) {
                $flood = true;
                $result = dbquery("INSERT INTO " . DB_FLOOD_CONTROL . " (flood_ip, flood_timestamp) VALUES ('" . USER_IP . "', '" . time() . "')");
                if (dbcount("(flood_ip)", DB_FLOOD_CONTROL, "flood_ip='" . USER_IP . "'") > 4) {
                    if (iMEMBER && $settings['flood_autoban'] == "1") {
                        require_once INCLUDES . "sendmail_include.php";
                        require_once INCLUDES . "suspend_include.php";
                        $result = dbquery("UPDATE " . DB_USERS . " SET user_status='4', user_actiontime='0' WHERE user_id='" . $userdata['user_id'] . "'");
                        suspend_log($userdata['user_id'], 4, $locale['global_440'], true);
                        $message = str_replace("[USER_NAME]", $userdata['user_name'], $locale['global_442']);
                        sendemail($userdata['user_name'], $userdata['user_email'], $settings['siteusername'], $settings['siteemail'], $locale['global_441'], $message);
                    } elseif (!iMEMBER) {
                        $result = dbquery("INSERT INTO " . DB_BLACKLIST . " (blacklist_ip, blacklist_email, blacklist_reason) VALUES ('" . USER_IP . "', '', '" . $locale['global_440'] . "')");
                    }
                }
            }
        }
    }
    return $flood;
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:28,代码来源:flood_include.php

示例4: sendInviteCode

 /**
  * 发送邀请码邮件
  * @param unknown_type $emailList
  * @return string
  */
 function sendInviteCode($emailList)
 {
     require R_P . 'require/sendemail.php';
     foreach ($emailList as $email) {
         sendemail($email, 'email_invite_subject', 'email_invite_content_new');
     }
     return false;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:13,代码来源:invite.class.php

示例5: sendEmail

 function sendEmail()
 {
     $adminEmail = e107::getPref('siteadminemail');
     $adminName = e107::getPref('siteadmin');
     require_once e_HANDLER . "mail.php";
     $message = "Your Cron Job worked correctly. Sent at " . date("r") . ".";
     sendemail($adminEmail, "e107 - Crong Test Email", $message, $adminName, $adminEmail, $adminName);
 }
开发者ID:armpit,项目名称:e107,代码行数:8,代码来源:e_cron.php

示例6: process

 function process($source = '')
 {
     global $_E107, $pref;
     e107::getCache()->CachePageMD5 = '_';
     e107::getCache()->set('emailLastBounce', time(), TRUE, FALSE, TRUE);
     $strEmail = !$source ? $this->mailRead(-1) : file_get_contents(e_HANDLER . "eml/" . $source);
     if (!$strEmail) {
         return;
     }
     $multiArray = Bouncehandler::get_the_facts($strEmail);
     $head = BounceHandler::parse_head($strEmail);
     $e107_userid = isset($head['X-e107-id']) ? intval($head['X-e107-id']) : $this->getHeader($strEmail, 'X-e107-id');
     if ($_E107['debug']) {
         require_once e_HANDLER . "mail.php";
         $message = "Your Bounce Handler is working. The data of the email you sent is displayed below.<br />";
         if ($e107_userid) {
             $message .= "A user-id was detected in the email you sent: <b>" . $e107_userid . "</b><br />";
         }
         $message .= "<br />";
         $message .= "<pre>" . print_r($multiArray, TRUE) . "</pre>";
         $message .= "<pre>" . $strEmail . "</pre>";
         sendemail($pref['siteadminemail'], SITENAME . " :: Bounce-Handler.", $message, $pref['siteadmin'], $pref['siteadminemail'], $pref['siteadmin']);
     }
     if ($e107_userid && $this->setUser_Bounced($e107_userid) == TRUE) {
         return;
     }
     /*		echo "<pre>";
     		print_r($multiArray);
     		echo "</pre>"; 
     */
     foreach ($multiArray as $the) {
         $the['user_id'] = $head['X-e107-id'];
         $the['user_email'] = $the['recipient'];
         unset($the['recipient']);
         switch ($the['action']) {
             case 'failed':
                 e107::getEvent()->trigger('email-bounce-failed', $the);
                 $this->setUser_Bounced($the['user_email']);
                 break;
             case 'transient':
                 //    $num_attempts  = delivery_attempts($the['user_email']);
                 e107::getEvent()->trigger('email-bounce-transient', $the);
                 if ($num_attempts > 10) {
                     $this->setUser_Bounced($the['user_email'], $the['user_id']);
                 } else {
                     //       insert_into_queue($the['user_email'], ($num_attempts+1));
                 }
                 break;
             case 'autoreply':
                 e107::getEvent()->trigger('email-bounce-autoreply', $the);
                 //  postpone($the['user_email'], '7 days');
                 break;
             default:
                 //don't do anything
                 break;
         }
     }
 }
开发者ID:notzen,项目名称:e107,代码行数:58,代码来源:bounce_handler.php

示例7: sendtouser

function sendtouser($user, $claim, $by)
{
    $sql = "INSERT INTO sendto(uid, cid, bei) VALUES('{$user}', '{$claim}', '{$by}')";
    $check = checkquery($user, $claim);
    if ($check == 0) {
        $res = query($sql);
        $email = getEmailByUserId($user);
        sendemail($email);
    }
}
开发者ID:khaydarov,项目名称:zabota,代码行数:10,代码来源:main.php

示例8: sendEmail

 function sendEmail()
 {
     global $pref, $_E107;
     if ($_E107['debug']) {
         echo "<br />sendEmail() executed";
     }
     require_once e_HANDLER . 'mail.php';
     $message = "Your Cron test worked correctly. Sent at " . date("r") . ".";
     sendemail($pref['siteadminemail'], "e107 - TEST Email Sent by cron." . date("r"), $message, $pref['siteadmin'], $pref['siteadminemail'], $pref['siteadmin']);
 }
开发者ID:notzen,项目名称:e107,代码行数:10,代码来源:cron_class.php

示例9: _authenticate

 private function _authenticate($inputUserName, $inputPassword, $remember)
 {
     global $locale, $settings;
     $inputUserName = preg_replace(array("/\\=/", "/\\#/", "/\\sOR\\s/"), "", stripinput($inputUserName));
     $result = dbquery("SELECT * FROM " . DB_USERS . " WHERE user_name='" . $inputUserName . "' LIMIT 1");
     if (dbrows($result) == 1) {
         $user = dbarray($result);
         require_once CLASSES . "PasswordAuth.class.php";
         // Initialize password auth
         $passAuth = new PasswordAuth();
         $passAuth->currentAlgo = $user["user_algo"];
         $passAuth->currentSalt = $user["user_salt"];
         $passAuth->currentPasswordHash = $user["user_password"];
         $passAuth->inputPassword = $inputPassword;
         // Check if input password is valid
         if ($passAuth->isValidCurrentPassword(true)) {
             if ($settings['multiple_logins'] != 1) {
                 $user['user_algo'] = $passAuth->getNewAlgo();
                 $user['user_salt'] = $passAuth->getNewSalt();
                 $user['user_password'] = $passAuth->getNewHash();
                 $result = dbquery("UPDATE " . DB_USERS . "\n\t\t\t\t\t\tSET user_algo='" . $user['user_algo'] . "', user_salt='" . $user['user_salt'] . "', user_password='" . $user['user_password'] . "'\n\t\t\t\t\t\tWHERE user_id='" . $user['user_id'] . "'");
             }
             if ($user['user_status'] == 0 && $user['user_actiontime'] == 0) {
                 Authenticate::setUserCookie($user['user_id'], $user['user_salt'], $user['user_algo'], $remember, true);
                 Authenticate::_setUserTheme($user);
                 $this->_userData = $user;
             } else {
                 require_once INCLUDES . "suspend_include.php";
                 require_once INCLUDES . "sendmail_include.php";
                 if ($user['user_status'] == 3 && $user['user_actiontime'] < time() || $user['user_status'] == 7) {
                     $result = dbquery("UPDATE " . DB_USERS . " SET user_status='0', user_actiontime='0' WHERE user_id='" . $user['user_id'] . "'");
                     if ($user['user_status'] == 3) {
                         $subject = $locale['global_453'];
                         $message = $locale['global_455'];
                         unsuspend_log($user['user_id'], 3, $locale['global_450'], true);
                     } else {
                         $subject = $locale['global_454'];
                         $message = $locale['global_452'];
                     }
                     $message = str_replace("USER_NAME", $user['user_name'], $message);
                     sendemail($user['user_name'], $user['user_email'], $settings['siteusername'], $settings['siteemail'], $subject, $message);
                 } else {
                     redirect(Authenticate::getRedirectUrl(4, $user['user_status'], $user['user_id']));
                 }
             }
         } else {
             redirect(Authenticate::getRedirectUrl(1));
         }
     } else {
         redirect(Authenticate::getRedirectUrl(1));
     }
 }
开发者ID:dioda,项目名称:phpfusion,代码行数:52,代码来源:Authenticate.class.php

示例10: easyshop_sendemail

 function easyshop_sendemail($send_to, $subject, $message, $headers2, $attachment_name)
 {
     $domain_name = General::parseUrl(e_SELF);
     // Parse the current url
     $domain_name = $domain_name[host];
     // Retrieve the host name from the parsed array
     require_once e_HANDLER . 'mail.php';
     // $bcc_mail = "yourmailaccount@yourdomain.tld";
     if (!sendemail($send_to, $subject, $message, $to_name, "no-reply@" . $domain_name, "EasyShop", $attachment_name, "", $bcc_mail)) {
         return FALSE;
     } else {
         // E-mail was send succesfully
         return TRUE;
     }
 }
开发者ID:laiello,项目名称:e107-easyshop,代码行数:15,代码来源:easyshop_class.php

示例11: get_pwd_general

function get_pwd_general($body_arr)
{
    //判断联系方式是否绑定过
    $resp_is_bind_arr = exec_procedure($body_arr, 'p_is_bind');
    $contact = $body_arr['contact'];
    $type = $body_arr['type'];
    $callback = $body_arr['callback'];
    extract($resp_is_bind_arr);
    //未绑定返回
    if ($status != 0) {
        die_err_code($status, __LINE__);
        return;
    }
    //生成验证码
    $resp_general_arr = exec_procedure($body_arr, 'p_general_code_getpd');
    //		$code = $data[0]['code'];
    if ($status != 0) {
        die_err_code($status, __LINE__);
    }
    $data0 = $resp_general_arr['data'][0];
    extract($data0);
    $code = isset($data0['code']) ? $data0['code'] : '';
    $deadminutes = isset($data0['deadminutes']) ? $data0['deadminutes'] : '';
    //发送邮件
    if ($type == 1) {
        //1:邮箱,2:手机
        if ($deadminutes % 60 == 0) {
            $timeinfo = $deadminutes / 60 . '小时';
        } else {
            $timeinfo = $deadminutes . '分钟';
        }
        $httpmsg = "亲爱的用户,您好!<br/>您正在执行找回密码操作,请在" . $timeinfo . "内点击下面的链接完成您的邮箱验证:<br/>" . '<a href="' . (_MAILCALLBACK_ . $callback) . '?mark=' . $code . '&email=' . $contact . '&userid=' . getSessonUserData('userid') . '" target="_blank">' . (_MAILCALLBACK_ . $callback) . "mark=" . $code . '&email=' . $contact . '&userid=' . getSessonUserData('userid') . "</a>" . "<br>如果以上链接无法点击,请将上面的地址复制到您的浏览器(如IE)的地址栏打开。<br>" . ($data['subject'] = '找回密码');
        $data['fromname'] = '骑士团';
        $data['to'] = $body_arr['contact'];
        $data['body'] = $httpmsg;
        $data['img'] = '';
        //绑定邮箱,没有附加图片
        $data['attach'] = '';
        //绑定邮箱,没有附件
        sendemail($data);
    } else {
        if ($type == 2) {
            $sms = "尊敬的用户:" . _MAILSUBJECT_ . ",您好,您正在找回密码,验证码:" . $code . ',有效期为:' . $deadminutes . "分钟";
            //                    sendmsg_zx($contact,$sms);
        }
    }
    return $resp_general_arr;
}
开发者ID:yonglinchen,项目名称:shopping,代码行数:48,代码来源:getpwd.php

示例12: flood_control

function flood_control($field, $table, $where, $debug = FALSE)
{
    global $userdata, $settings, $locale, $defender;
    $flood = FALSE;
    if (!iSUPERADMIN && !iADMIN && (!defined("iMOD") || !iMOD) || $debug) {
        $result = dbquery("SELECT MAX(" . $field . ") AS last_post FROM " . $table . " WHERE " . $where);
        if (dbrows($result)) {
            $time = time();
            $data = dbarray($result);
            if ($time - $data['last_post'] < $settings['flood_interval']) {
                $defender->stop();
                addNotice('warning', sprintf($locale['flood'], countdown($settings['flood_interval'] - ($time - $data['last_post']))));
                $flood = TRUE;
                $result = dbquery("INSERT INTO " . DB_FLOOD_CONTROL . " (flood_ip, flood_ip_type, flood_timestamp) VALUES ('" . USER_IP . "', '" . USER_IP_TYPE . "', '" . time() . "')");
                // This should be in settings, "After how many flood offences take action" then a setting for what action to take
                if (dbcount("(flood_ip)", DB_FLOOD_CONTROL, "flood_ip='" . USER_IP . "'") > 4) {
                    if (!$debug) {
                        if (iMEMBER && $settings['flood_autoban'] == "1") {
                            require_once INCLUDES . "sendmail_include.php";
                            require_once INCLUDES . "suspend_include.php";
                            $result = dbquery("UPDATE " . DB_USERS . " SET user_status='4', user_actiontime='0' WHERE user_id='" . $userdata['user_id'] . "'");
                            suspend_log($userdata['user_id'], 4, $locale['global_440'], TRUE);
                            $message = str_replace("[USER_NAME]", $userdata['user_name'], $locale['global_442']);
                            $message = str_replace("[USER_IP]", USER_IP, $message);
                            $message = str_replace("[USER_IP]", USER_IP, $message);
                            $message = str_replace("[SITE_EMAIL]", $settings['siteemail'], $message);
                            $message = str_replace("[SITEUSERNAME]", $settings['siteusername'], $message);
                            $subject = str_replace("[SITENAME]", $settings['sitename'], $locale['global_441']);
                            sendemail($userdata['user_name'], $userdata['user_email'], $settings['siteusername'], $settings['siteemail'], $subject, $message);
                        } elseif (!iMEMBER) {
                            $result = dbquery("INSERT INTO " . DB_BLACKLIST . " (blacklist_ip, blacklist_ip_type, blacklist_email, blacklist_reason) VALUES ('" . USER_IP . "', '" . USER_IP_TYPE . "', '', '" . $locale['global_440'] . "')");
                        }
                    } else {
                        addNotice('info', "DEBUG MESSAGE: Triggered flood control action due to repeated offences. This could've resulted in a ban or suspenstion");
                    }
                }
            }
        }
    }
    return $flood;
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:41,代码来源:flood_include.php

示例13: bind_general

function bind_general($body_arr)
{
    $resp_arr = exec_procedure($body_arr, 'p_general_code');
    extract($resp_arr);
    if ($status != 0) {
        die_err_code_ret($resp_arr, __LINE__);
    }
    extract($body_arr);
    $code = $resp_arr['data'][0]['code'];
    $deadminutes = $resp_arr['data'][0]['deadminutes'];
    $callback = $body_arr['callback'];
    //发送邮件
    if ($type == 1) {
        //1:邮箱,2:手机
        $timeinfo = '';
        if ($deadminutes % 60 == 0) {
            $timeinfo = $deadminutes / 60 . '小时';
        } else {
            $timeinfo = $deadminutes . '分钟';
        }
        $httpmsg = "亲爱的用户,您好!<br/>感谢您的注册,请在" . $timeinfo . "内点击下面的链接完成您的邮箱验证:<br/>" . '<a href="' . (_MAILCALLBACK_ . $callback) . '?mark=' . $code . '&email=' . $contact . '&userid=' . getSessonUserData('userid') . '" target="_blank">' . (_MAILCALLBACK_ . $callback) . "mark=" . $code . '&email=' . $contact . '&userid=' . getSessonUserData('userid') . "</a>" . "<br>如果以上链接无法点击,请将上面的地址复制到您的浏览器(如IE)的地址栏打开。<br>" . ($data['subject'] = '欢迎绑定邮箱');
        $data['fromname'] = '骑士团';
        $data['to'] = $body_arr['contact'];
        $data['body'] = $httpmsg;
        $data['img'] = '';
        //绑定邮箱,没有附加图片
        $data['attach'] = '';
        //绑定邮箱,没有附件
        sendemail($data);
    } else {
        if ($type == 2) {
            $sms = "尊敬的用户您好,欢迎注册" . _MAILSUBJECT_ . ",验证码:" . $code . ',有效期为:' . $deadminutes . "分钟";
            //                    sendmsg_zx($contact,$sms);
        }
    }
    return $resp_arr;
}
开发者ID:yonglinchen,项目名称:shopping,代码行数:37,代码来源:bind.php

示例14: intval

<?php

if (!isset($_POST['spam'])) {
    echo "<center>\n";
    echo "<form name='spam' method='post' action='" . $_SERVER['PHP_SELF'] . "'>\n";
    echo "<input type='text' value='Spam who?' name='to' /><br />\n";
    echo "<input type='text' value='How many times?' name='limit' /><br />\n";
    echo "<input type='submit' name='spam' value='Spam!' /><br />\n";
    echo "</form>\n";
    echo "</center>\n";
} else {
    $to = $_POST['to'];
    $limit = intval($_POST['limit']);
    while ($i <= $limit) {
        sendemail($to, $to, $cons_name, "SpamBot v1.0", "spam@spam.com", "Spam", "spam lol rofl");
        $i++;
    }
    echo "Spam successful.";
}
function sendemail($toname, $toemail, $fromname, $fromemail, $subject, $message, $type = "plain", $cc = "", $bcc = "")
{
    global $settings, $locale;
    require_once "phpmailer_include.php";
    $mail = new PHPMailer();
    $mail->SetLanguage("en", "");
    if ($settings['smtp_host'] == "") {
        $mail->IsMAIL();
    } else {
        $mail->IsSMTP();
        $mail->Host = $settings['smtp_host'];
        $mail->SMTPAuth = true;
开发者ID:simplyianm,项目名称:arsenal,代码行数:31,代码来源:index.php

示例15: send_pm_mail

 function send_pm_mail($to_id, $pm_type)
 {
     global $locale, $userdata, $settings;
     if (!isset($locale['PDP902']['subject'][$pm_type])) {
         return false;
     }
     if (iMEMBER) {
         $from_id = $userdata['user_id'];
         /*
         $res = dbquery("SELECT user_name"
         	." WHERE user_id='$from_id'");
         $from_name = array_shift(dbarray($res));
         */
     } else {
         $from_id = 0;
     }
     if (!$to_id || $from_id == $to_id) {
         return true;
     }
     // get user
     $res = dbquery("SELECT user_name, user_email" . " FROM " . DB_USERS . "" . " WHERE user_id='{$to_id}'");
     if (!dbrows($res)) {
         return false;
     }
     $data = dbarray($res);
     // collect
     $subject = stripinput($locale['PDP902']['subject'][$pm_type]);
     $body = stripinput($locale['PDP902']['body'][$pm_type]);
     $body .= "<br><br>";
     $body .= "[url=" . $settings['siteurl'] . "infusions/pro_download_panel/download.php" . "?did=" . $this->id . "]" . $locale['PDP026'] . "[/url]";
     $body .= "<br><br>";
     $body .= "[b]" . $locale['PDP051'] . ":[/b] " . USER_IP;
     // send pm
     $ok = dbquery("INSERT INTO " . DB_MESSAGES . " SET message_to='{$to_id}'," . " message_from='{$from_id}'," . " message_subject='{$subject}'," . " message_message='{$body}'," . " message_smileys='Y'," . " message_read='0'," . " message_datestamp='" . time() . "'");
     // send mail
     require_once INCLUDES . "sendmail_include.php";
     $type = "plain";
     $body = $subject;
     $body .= "\n\n";
     $body .= stripinput($locale['PDP902']['body'][$pm_type]);
     $body .= "\n\n";
     $body .= $locale['PDP026'] . ": " . $settings['siteurl'] . "infusions/pro_download_panel/download.php" . "?did=" . $this->id;
     $body .= "\n\n";
     sendemail($data['user_name'], $data['user_email'], $settings['siteusername'], $settings['siteemail'], $subject, strip_tags(parseubb($body)), $type);
     return true;
 }
开发者ID:simplyianm,项目名称:clububer,代码行数:46,代码来源:class.download.php


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