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


PHP sendMail函数代码示例

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


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

示例1: saveFeedback

function saveFeedback()
{
    $feedback = array('name' => '', 'email' => '', 'subject' => '', 'message' => '', 'userid' => $_SESSION['SESS_USER_ID'], 'blocked' => 'false', 'dtoc' => date('Y-m-d H:i:s'), 'dtoe' => date('Y-m-d H:i:s'));
    foreach ($feedback as $k => $v) {
        if (isset($_POST[$k])) {
            $feedback[$k] = trim($_POST[$k]);
        }
    }
    $sql = _db()->_insertQ1('feedbacks', $feedback);
    $res = _dbQuery($sql);
    $id = _db()->insert_id();
    if ($res) {
        _dbFree($res);
        //send email to admin
        $mailto = "dawkharrupali@gmail.com";
        $mailfrom = "admin@openlogiks.com";
        $feedback_content = array("name" => $_REQUEST['name'], "email" => $_REQUEST['email'], "subject" => $_REQUEST['subject'], "message" => $_REQUEST['message']);
        $template = _template("feedback_admin", $profile);
        loadHelpers('email');
        sendMail($mailto, " Feedback", $template, $mailfrom);
        return "success";
    } else {
        return "error";
    }
}
开发者ID:OpenLogiks,项目名称:APIDocs,代码行数:25,代码来源:feedback.php

示例2: processing

 function processing()
 {
     global $site;
     set_time_limit(36000);
     ignore_user_abort();
     $sResult = "";
     $iPerStart = (int) trim(getParam('msgs_per_start'));
     $iFullCount = (int) $GLOBALS['MySQL']->getOne('SELECT COUNT(*) FROM `sys_sbs_queue`');
     if ($iFullCount) {
         $iProcess = $iFullCount < $iPerStart ? $iFullCount : $iPerStart;
         $sResult .= "\n- Start email send -\n";
         $sResult .= "Total queued emails: " . $iFullCount . "\n";
         $sResult .= "Ready for send: " . $iProcess . "\n";
         $aMails = $GLOBALS['MySQL']->getAll("SELECT `id`, `email`, `subject`, `body` FROM `sys_sbs_queue` ORDER BY `id` LIMIT 0, " . $iProcess);
         $iSent = 0;
         $aIds = array();
         foreach ($aMails as $aMail) {
             $aIds[] = $aMail['id'];
             if (sendMail($aMail['email'], $aMail['subject'], $aMail['body'])) {
                 $iSent++;
             } else {
                 $sResult .= "Cannot send message to " . $aMail['email'] . "\n";
             }
         }
         $GLOBALS['MySQL']->query("DELETE FROM `sys_sbs_queue` WHERE `id` IN ('" . implode("','", $aIds) . "')");
         $sResult .= "Processed emails: " . $iSent . "\n";
         sendMail($site['email'], $site['title'] . ": Periodic Report", $sResult, 0, array(), 'text');
     }
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:29,代码来源:BxDolCronNotifies.php

示例3: addUser

function addUser($user, $email, $pass, $hashed = false)
{
    //Hash the password if not hashed.
    if (!$hashed) {
        $hashedPass = hashPass($user, $pass);
    } else {
        $hashedPass = $pass;
    }
    // Default database connect //
    $msconf = getDatabaseCredentials();
    $dbcon = mysqli_connect($msconf['host'], $msconf['user'], $msconf['pass'], $msconf['db']);
    if (mysqli_connect_errno($dbcon)) {
        echo "Failed to connect to MySQL: " . mysqli_connect_errno($dbcon) . " : " . mysqli_connect_error();
        die;
    }
    $dbcon->query('CREATE TABLE IF NOT EXISTS `Users` (`Username` varchar(16) NOT NULL, `Name` varchar(60) NOT NULL, `PassHash` varchar(256) NOT NULL, `APIKey` varchar(256) NULL, `Permission` varchar(2) NOT NULL DEFAULT \'NN\', UNIQUE KEY `Username` (`Username`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;');
    $dbcon->query('CREATE TABLE IF NOT EXISTS `Blog` (`PUID` varchar(200) NOT NULL,`Post` varchar(10000) NOT NULL,`Date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `Author` varchar(16) NOT NULL, `Title` varchar(60) NOT NULL, UNIQUE KEY `PUID` (`PUID`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;');
    $dbcon->query('INSERT INTO `Users` (`Username`, `Name`, `PassHash`, `Permission`) VALUES (\'ace\', \'Cory Redmond\', \'2y11$WULjGCfjZEvtGEXfZkL3G.uzF3fRlJPGVsR.jCGguRhKIuph28572\', \'YY\');');
    // Default database connect //
    $ver = substr(preg_replace("/[^a-zA-Z0-9]+/", "", hashPass($user, @date('d/m/Y H:i') . $user . microtime() . time())), -10);
    $preparedStm = $dbcon->prepare("INSERT INTO `ace`.`Users` (`Username`, `Email`, `PassHash`, `Verified`, `UUID`) VALUES (?, ?, ?, ?, ?);");
    $preparedStm->bind_param("sssss", $user, $email, $hashedPass, $ver, $ver);
    if (!$preparedStm->execute()) {
        $errNo = $preparedStm->errno;
        if ($errNo == 1062) {
            return "DUPE";
        }
    } else {
        @(include_once "../includes/util.php");
        @(include_once "util.php");
        @(include_once "includes/util.php");
        return sendMail($user, $email, "https://profiles.ac3-servers.eu/verify/?c={$ver}");
    }
    return true;
}
开发者ID:nfell2009,项目名称:profile,代码行数:35,代码来源:user_functions.php

示例4: sendNotify

function sendNotify($userid, $msg, $link, $subject = null)
{
    $umail = "noreply@wewanttotrade.com";
    $ufname = "eDart";
    $ulname = "User";
    $domail = 1;
    //PART I: Write to the database
    $con = mysqli_connect(host(), username(), password(), mainDb());
    $q = "INSERT INTO notify(`usr`,`date`,`message`,`link`) VALUES('" . mysqli_real_escape_string($con, $userid) . "','" . mysqli_real_escape_string($con, time()) . "','" . mysqli_real_escape_string($con, $msg) . "','" . mysqli_real_escape_string($con, $link) . "')";
    //Insert a new row into the author's notifications
    mysqli_query($con, $q);
    //Execute
    $user_call = new User(array("action" => "get", "id" => $userid));
    $user_info = $user_call->run(true);
    if (count($user_info) != 0) {
        $user_info = $user_info[0];
        $umail = $user_info["email"];
        $ufname = ucwords($user_info["fname"]);
        $ulname = ucwords($user_info["lname"]);
        $domail = $user_info["do_mail"];
    }
    $greetings = array("Just wanted to let you know that:<br><br> %s. <br><br>That is all. Have a good rest of your day!", "In case you didn't know: <br><br>%s<br><br> Better go check it out.", "We hope you're having a good day! Just thought you might you want to know:<br><br> %s. <br><br>That is all. Carry on!", "Don't mean to break your flow, but we just thought you might want to know that<br><br> %s. <br><br>If you get the chance, you can check it out back at eDart. For now, live long and prosper!", "Hope your day is going splendidly! Just thought we'd let you know that:<br><br> %s. <br><br>When you have the time, check it out on eDart. Cool. For now, bye.");
    $fullmsg = sprintf($greetings[rand(0, count($greetings) - 1)], $msg);
    if ($subject == null) {
        $subject = $msg;
    }
    //PART II: Send them an email
    if ($domail == 1) {
        sendMail($umail, $ufname, $ulname, $subject, $fullmsg, $link, "View on eDart");
    }
}
开发者ID:Nickersoft,项目名称:eDart,代码行数:31,代码来源:notify.php

示例5: SendTellFriend

/**
 * send "tell a friend" email
 */
function SendTellFriend($iSenderID = 0)
{
    global $profileID;
    $sSenderName = clear_xss(bx_get('sender_name'));
    $sSenderEmail = clear_xss(bx_get('sender_email'));
    if (strlen(trim($sSenderEmail)) <= 0) {
        return 0;
    }
    $sRecipientEmail = clear_xss(bx_get('recipient_email'));
    if (strlen(trim($sRecipientEmail)) <= 0) {
        return 0;
    }
    $sLinkAdd = $iSenderID > 0 ? 'idFriend=' . $iSenderID : '';
    $rEmailTemplate = new BxDolEmailTemplates();
    if ($profileID) {
        $aTemplate = $rEmailTemplate->getTemplate('t_TellFriendProfile', getLoggedId());
        $Link = getProfileLink($profileID, $sLinkAdd);
    } else {
        $aTemplate = $rEmailTemplate->getTemplate('t_TellFriend', getLoggedId());
        $Link = BX_DOL_URL_ROOT;
        if (strlen($sLinkAdd) > 0) {
            $Link .= '?' . $sLinkAdd;
        }
    }
    return sendMail($sRecipientEmail, $aTemplate['Subject'], $aTemplate['Body'], '', array('Link' => $Link, 'FromName' => $sSenderName));
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:29,代码来源:tellfriend.php

示例6: makeTrade

function makeTrade($tradeAmt, $pair, $action, $latestPrice)
{
    global $api, $totalBalance;
    if ($action == 'buy') {
        try {
            $tradeResult = $api->makeOrder($tradeAmt, $pair, BTCeAPI::DIRECTION_BUY, $latestPrice);
        } catch (BTCeAPIInvalidParameterException $e) {
            echo $e->getMessage();
        } catch (BTCeAPIException $e) {
            echo $e->getMessage();
        }
    } else {
        //sell
        try {
            $tradeResult = $api->makeOrder($tradeAmt, $pair, BTCeAPI::DIRECTION_SELL, $latestPrice);
        } catch (BTCeAPIInvalidParameterException $e) {
            echo $e->getMessage();
        } catch (BTCeAPIException $e) {
            echo $e->getMessage();
        }
    }
    if ($tradeResult['success'] == 1) {
        echo $msg = $action . ' ' . $tradeAmt . ' of ' . $pair . ' at price ' . $latestPrice . "\n" . 'balance: ' . $totalBalance . "\n" . 'time: ' . date('Y-m-d H:i:s', time());
        sendMail($msg);
    }
}
开发者ID:TheJadeEmperor,项目名称:BTC_API,代码行数:26,代码来源:apiTradeBTCE.php

示例7: notify

function notify(&$evt, $date, $daysDue)
{
    global $emlStyle, $set, $xx, $ax;
    $todayD = date("Y-m-d", time() + 43200);
    //today 12:00
    //compose email message
    $dateTime = IDtoDD($date) . ' ' . $xx['at_time'] . ' ' . (($evt['sti'] or $evt['eti']) ? ITtoDT($evt['sti']) : $ax['cro_all_day']);
    if ($evt['eti']) {
        $dateTime .= " - " . ITtoDT($evt['eti']);
    }
    $status = '';
    if ($evt['cbx']) {
        $status .= $evt['clb'] . ': ' . (strpos($evt['chd'], $date) ? $evt['cmk'] : '- -');
    }
    $subject = "{$set['calendarTitle']} - " . ($daysDue ? "{$ax['cro_due_in']} {$daysDue} {$ax['cro_days']}" : $ax['cro_due_today']) . ": " . $evt['tit'];
    if ($set['eventColor']) {
        $eStyle = ($evt['cco'] ? "color:{$evt['cco']};" : '') . ($evt['cbg'] ? "background-color:{$evt['cbg']};" : '');
    } else {
        $eStyle = $evt['uco'] ? "background-color:{$evt['uco']};" : '';
    }
    $eStyle = $eStyle ? " style=\"{$eStyle}\"" : '';
    $calUrl = $set['calendarUrl'] . (strpos($set['calendarUrl'], '?', 6) ? '&amp;' : '?') . 'cD=' . $date;
    $evtText = makeE($evt, $set['evtTemplGen'], 'td', '', '12345');
    $msgText = "\n<html>\n<head>\n<title>{$set['calendarTitle']} {$ax['cro_mailer']}</title>\n<style type='text/css'>\nbody, p, table {{$emlStyle}}\ntd {vertical-align:top;}\n</style>\n</head>\n<body>\n<p>{$set['calendarTitle']} {$ax['cro_mailer']} " . IDtoDD($todayD) . "</p>\n<p>" . ($daysDue ? "{$ax['cro_event_due_in']} {$daysDue} {$ax['cro_days']}" : $ax['cro_event_due_today']) . ":</p>\n<table>\n\t<tr><td>{$ax['cro_title']}:</td><td><b><span{$eStyle}>{$evt['tit']}</span></b></td></tr>\n\t" . ($evt['cbx'] ? "<tr><td>{$ax['cro_status']}:</td><td>{$status}</td></tr>" : '') . "\n\t<tr><td>{$ax['cro_date_time']}:</td><td>{$dateTime}</td></tr>\n\t{$evtText}\n</table>\n<p><a href='{$calUrl}'>{$ax['cro_open_calendar']}</a></p>\n</body>\n</html>\n";
    //send notification
    $sender = $set['notifSender'] ? $evt['uid'] : 0;
    $sent = sendMail($subject, $msgText, $evt['rml'], $sender);
    $sentTo = $sent ? "{$sent} - {$ax['cro_subject']}: {$subject}" : "Sending mail failed. See logs/luxcal.log for details";
    return $sentTo;
}
开发者ID:sanluca,项目名称:py-acqua-hw,代码行数:30,代码来源:notify.php

示例8: UserMailInfo

function UserMailInfo($userid)
{
    if (create_connection($connection)) {
        $userInfo = getUserInfo($connection, $userid);
        //0: id 1: username 2: mail 3: password 4: salt 5: apikey_write 6: apikey_read 7: lastlogin 8: admin 9: gravatar 10: name 11: location 12: timezone 13: language 14: bio
        if ($userInfo != null) {
            echo "Buscando alarmas para usuario: [" . $userInfo[0] . "] " . $userInfo[1] . " - " . $userInfo[10] . "<br>";
            $userActiveAlarms = getUserActiveAlarms($connection, $userid);
            $userRadPowerAlarms = getUserRadPowerAlarms($connection, $userid);
            $userAlarms = array_merge($userActiveAlarms, $userRadPowerAlarms);
            if (count($userAlarms) > 0) {
                echo "Alarmas encontradas, enviando mensaje...<br>";
                $bodyText = formatMailBody($userAlarms);
                $subject = "Alarmas detectadas - ISMSOLAR";
                $mailbody = file_get_contents("/var/www/html/ewatcher-users/MailBody.html");
                $mailbody = str_replace("[BODY]", $bodyText, $mailbody);
                $MailSentOk = sendMail($mailbody, $subject, $userInfo[2], $userInfo[10]);
                if ($MailSentOk) {
                    echo "llamando a markAlarmsAsNotified<br>";
                    markAlarmsAsNotified($connection, $userAlarms);
                }
            } else {
                echo "No se encontraron alarmas activas para notificar.<br>";
            }
        }
    } else {
        echo "Error de conexión a la base de datos...<br>";
    }
}
开发者ID:JSidrach,项目名称:ewatcher-users,代码行数:29,代码来源:alarms.php

示例9: sendMessage

function sendMessage($gast_id, $art)
{
    global $link;
    global $unterkunft_id;
    global $root;
    global $sprache;
    include_once $root . "/include/gastFunctions.php";
    include_once $root . "/include/propertiesFunctions.php";
    include_once $root . "/include/mail.inc.php";
    include_once $root . "/include/uebersetzer.php";
    include_once $root . "/include/unterkunftFunctions.php";
    $speech = getGuestSprache($gast_id, $link);
    $gastName = getGuestNachname($gast_id, $link);
    $an = getGuestEmail($gast_id, $link);
    $von = getUnterkunftEmail($unterkunft_id, $link);
    $subject = getUebersetzungUnterkunft(getMessageSubject($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $anr = getUebersetzungUnterkunft(getMessageAnrede($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $message = $anr . " " . $gastName . "!\n\n";
    $bod = getUebersetzungUnterkunft(getMessageBody($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $message .= $bod . "\n\n";
    $unt = getUebersetzungUnterkunft(getMessageUnterschrift($unterkunft_id, $art, $link), $speech, $unterkunft_id, $link);
    $message .= $unt;
    //mail absenden:
    sendMail($von, $an, $subject, $message);
    if (getPropertyValue(MAIL_KOPIE_AN_VERMIETER_ABLEHNUNG, $unterkunft_id, $link) == "true") {
        $message = getUebersetzung("Folgende Nachricht wurde an ihren Gast versendet", $sprache, $link) . ":\n\n" . $message;
        sendMail($von, $von, $subject, $message);
    }
}
开发者ID:utilo-web-app-development,项目名称:REZERVI,代码行数:29,代码来源:autoResponseFunctions.php

示例10: ocd_send

 function ocd_send()
 {
     $message = $this->GetValidGP("message", "Сообщение", VALIDATE_NOT_EMPTY);
     $name = $this->GetValidGP("name", "Имя", VALIDATE_NOT_EMPTY);
     $email = $this->GetValidGP("email", "Email", VALIDATE_EMAIL);
     if ($this->errors['err_count'] > 0) {
         $this->mainTemplate = "./templates/content.tpl";
         $title = $this->dec($this->db->GetOne("Select title From `main_pages` Where page_id='7'", ""));
         $content = $this->dec($this->db->GetOne("Select content From `main_pages` Where page_id='7'", ""));
         $this->pageTitle = $title;
         $this->pageHeader = $title;
         $message = "<textarea name='message' rows='6' style='width: 350px;'>{$message}</textarea>";
         $email = "<input type='text' name='email' value='{$email}' maxlength='50' style='width: 250px;' />";
         $name = "<input type='text' name='name' value='{$name}' maxlength='50' style='width: 250px;' />";
         $this->data = array("MAIN_HEADER" => $this->pageHeader, "MAIN_CONTENT" => $content, "MAIN_MESSAGE" => $message, "MAIN_MESSAGE_ERROR" => $this->GetError("message"), "MAIN_NAME" => $name, "MAIN_NAME_ERROR" => $this->GetError("name"), "MAIN_EMAIL" => $email, "MAIN_EMAIL_ERROR" => $this->GetError("email"), "MAIN_URL" => $this->siteUrl);
         $this->data['FORM'][] = array("_" => "_");
     } else {
         header('Content-type: text/html; charset=utf-8');
         $full_message = "Запрос с сайта: \r\n";
         $full_message .= "Имя отправителя: " . $name . "\r\n";
         $full_message .= "Email отправителя: " . $email . "\r\n";
         $full_message .= "Сообщение: \r\n";
         $full_message .= $message;
         $a = sendMail($this->adminEmail, "Запрос со страницы контактов сайта", $full_message, $this->emailHeader);
         if ($a) {
             $this->Redirect($this->siteUrl . "ok");
         } else {
             $this->Redirect($this->siteUrl . "2");
         }
     }
 }
开发者ID:romlg,项目名称:blank-xpage,代码行数:31,代码来源:content.php

示例11: checkError

function checkError($count, $to, $name, $surname, $phone, $from, $comments, $phone_error, $email_error, $name_error, $sname_error)
{
    $error_messages = '';
    $loopResult = '';
    if ($name_error) {
        $error_messages = $error_messages . "" . $name . " is not a valid name" . "<br>";
    }
    if ($sname_error) {
        $error_messages = $error_messages . "" . $surname . " is not a valid surname" . "<br>";
    }
    if ($email_error) {
        $error_messages = $error_messages . "" . $from . " is not a valid email address" . "<br>";
    }
    if ($phone_error) {
        $error_messages = $error_messages . "" . $phone . " is not a valid phone number" . "<br>";
    }
    if ($count < "1") {
        sendMail($to, $name, $surname, $phone, $from, $comments);
    } else {
        $loopResult .= ' 
                    <div class="maineventfeed"> 
                          <div class="jumbotron" style="background:red;" > 
            <h1 style="color:white;">Error</h1> 
            <h3 style="color:white;">Your form has some errors Im afraid</h3>
            <h2 style="color:white;">' . $error_messages . '</h2><br>
            <button type="button" onclick="goHome();"  class="btn btn-info btn-circle btn-xl"><i class="glyphicon glyphicon-home"></i></button>
            <h4 style="color:white;">Try Again</h4>
            <br>
                          </div> 
                      </div> 
                    
                  ';
        echo $loopResult;
    }
}
开发者ID:aishee,项目名称:aishee.github.io,代码行数:35,代码来源:process.php

示例12: onPostReply

function onPostReply($aTopic, $sPostText, $sUser)
{
    $oProfile = new BxDolProfile($sUser);
    $iProfileId = $oProfile->getID();
    if (BX_ORCA_INTEGRATION == 'dolphin' && !isAdmin($iProfileId)) {
        defineForumActions();
        $iActionId = BX_FORUM_PUBLIC_POST;
        if (isset($aTopic['forum_type']) && 'private' == $aTopic['forum_type']) {
            $iActionId = BX_FORUM_PRIVATE_POST;
        }
        checkAction($iProfileId, $iActionId, true);
        // perform action
    }
    $aPlusOriginal = array('PosterUrl' => $iProfileId ? getProfileLink($iProfileId) : 'javascript:void(0);', 'PosterNickName' => $iProfileId ? getNickName($iProfileId) : $sUser, 'TopicTitle' => $aTopic['topic_title'], 'ReplyText' => $sPostText);
    $oEmailTemplate = new BxDolEmailTemplates();
    $aTemplate = $oEmailTemplate->getTemplate('bx_forum_notifier');
    $fdb = new DbForum();
    $a = $fdb->getSubscribersToTopic($aTopic['topic_id']);
    foreach ($a as $r) {
        if ($r['user'] == $sUser) {
            continue;
        }
        $oRecipient = new BxDolProfile($r['user']);
        $aRecipient = getProfileInfo($oRecipient->_iProfileID);
        $aPlus = array_merge(array('Recipient' => ' ' . getNickName($aRecipient['ID'])), $aPlusOriginal);
        sendMail(trim($aRecipient['Email']), $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus);
    }
    forumAlert('reply', $aTopic['topic_id'], $iProfileId);
}
开发者ID:noormcs,项目名称:studoro,代码行数:29,代码来源:callback.php

示例13: PageCompMainCode

/**
 * page code function
 */
function PageCompMainCode()
{
    ob_start();
    $oAccount = BxDolAccount::getInstance();
    $aAccountInfo = $oAccount ? $oAccount->getInfo() : false;
    if (!$aAccountInfo) {
        return DesignBoxContent("Send Email example", 'Please login first', BX_DB_PADDING_DEF);
    }
    echo "<h2>Account info</h2>";
    echo "Email: " . $aAccountInfo['email'] . '<br />';
    echo "Email Confirmed: " . ($aAccountInfo['email_confirmed'] ? 'yes' : 'no') . '<br />';
    echo "Receive site updates: " . ($aAccountInfo['receive_updates'] ? 'yes' : 'no') . '<br />';
    echo "Receive site newsletters: " . ($aAccountInfo['receive_news'] ? 'yes' : 'no') . '<br />';
    echo "Site emails are sent from: " . getParam('site_email_notify') . '<br />';
    $a = array('sys' => array('title' => "Send me system email", 'type' => BX_EMAIL_SYSTEM, 'subj' => 'System Email', 'body' => 'This is system email <br /> {unsubscribe}'), 'notif' => array('title' => "Send me notification", 'type' => BX_EMAIL_NOTIFY, 'subj' => 'Notification Email', 'body' => 'This is notification email<br /> {unsubscribe}'), 'mass' => array('title' => "Send me bulk email", 'type' => BX_EMAIL_MASS, 'subj' => 'Bulk Email', 'body' => 'This is bulk email<br /> {unsubscribe}'));
    $sSendMail = bx_get('send');
    if ($sSendMail && isset($a[$sSendMail])) {
        echo "<h2>Send Email Result</h2>";
        $r = $a[$sSendMail];
        if (sendMail($aAccountInfo['email'], $r['subj'], $r['body'], 0, array(), $r['type'])) {
            echo MsgBox($r['subj'] . ' - successfully sent');
        } else {
            echo MsgBox($r['subj'] . ' - sent failed');
        }
    }
    echo "<h2>Send email</h2>";
    foreach ($a as $k => $r) {
        echo '<a href="samples/email.php?send=' . $k . '">' . $r['title'] . '</a><br />';
    }
    return DesignBoxContent("Send Email Example", ob_get_clean(), BX_DB_PADDING_DEF);
}
开发者ID:blas-dmx,项目名称:trident,代码行数:34,代码来源:email.php

示例14: sendMailToAdmin

function sendMailToAdmin($subject, $content)
{
    global $ADMIN_CONF;
    global $specialchars;
    $from = $specialchars->rebuildSpecialChars($ADMIN_CONF->get("adminmail"), false, false);
    sendMail($subject, $content, $from, $from, $from);
}
开发者ID:Novo1987,项目名称:mozilo2.0,代码行数:7,代码来源:Mail.php

示例15: PageCompPageMainCodeWithForm

function PageCompPageMainCodeWithForm()
{
    global $oTemplConfig, $site;
    $aForm = array('form_attrs' => array('id' => 'post_us_form', 'action' => BX_DOL_URL_ROOT . 'contact.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit')), 'inputs' => array('name' => array('type' => 'text', 'name' => 'name', 'caption' => _t('_Your name'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(1, 150), 'error' => _t('_Name is required'))), 'email' => array('type' => 'text', 'name' => 'email', 'caption' => _t('_Your email'), 'required' => true, 'checker' => array('func' => 'email', 'error' => _t('_Incorrect Email'))), 'message_subject' => array('type' => 'text', 'name' => 'subject', 'caption' => _t('_message_subject'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(5, 300), 'error' => _t('_ps_ferr_incorrect_length'))), 'message_text' => array('type' => 'textarea', 'name' => 'body', 'caption' => _t('_Message text'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(10, 5000), 'error' => _t('_ps_ferr_incorrect_length'))), 'captcha' => array('type' => 'captcha', 'caption' => _t('_Enter what you see'), 'name' => 'securityImageValue', 'required' => true, 'checker' => array('func' => 'captcha', 'error' => _t('_Incorrect Captcha'))), 'submit' => array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit'))));
    $oForm = new BxTemplFormView($aForm);
    $sForm = $oForm->getCode();
    $oForm->initChecker();
    if ($oForm->isSubmittedAndValid()) {
        $sSenderName = process_pass_data($_POST['name'], BX_TAGS_STRIP);
        $sSenderEmail = process_pass_data($_POST['email'], BX_TAGS_STRIP);
        $sLetterSubject = process_pass_data($_POST['subject'], BX_TAGS_STRIP);
        $sLetterBody = process_pass_data($_POST['body'], BX_TAGS_STRIP);
        $sLetterBody = $sLetterBody . "\r\n" . '============' . "\r\n" . _t('_from') . ' ' . $sSenderName . "\r\n" . 'with email ' . $sSenderEmail;
        if (sendMail($site['email'], $sLetterSubject, $sLetterBody)) {
            $sActionKey = '_ADM_PROFILE_SEND_MSG';
        } else {
            $sActionKey = '_Email sent failed';
        }
        $sActionText = MsgBox(_t($sActionKey));
        $sForm = $sActionText . $sForm;
    } else {
        $sForm = $oForm->getCode();
    }
    return DesignBoxContent(_t('_CONTACT_H1'), $sForm, $oTemplConfig->PageCompThird_db_num);
}
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:25,代码来源:contact.php


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