• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP format_email函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: send_email

function send_email($info)
{
    //format each email
    $body = format_email($info, 'html');
    $body_plain_txt = format_email($info, 'txt');
    //setup the mailer
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject('Welcome to Geo Home For you');
    $message->setFrom(array('[email protected]' => 'Site Name'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    $message->addPart($body, 'text/html');
    echo "WHAT";
    echo $message;
    //$to = "[email protected]";
    //$sub = "Te_subject_of_your_email";
    //$mess = "Dear User, \r\n\r\n";
    //$mess .= "This is your message \r\n";
    //$headers = "From: [email protected] \r\n";
    //$test = mail($to,$subj,$mess,$headers);
    //if (test){echo "TRUE";}else{echo "FALSE";}
    $result = $mailer->send($message);
    return $result;
}
开发者ID:Tepnimit,项目名称:Geo-Home-Systems,代码行数:26,代码来源:functions.php


示例2: test_format_email

 /**
  * bootstrap.php: format_email()
  */
 function test_format_email()
 {
     $data = array('' => '', 'test' => 'test', '[email protected]' => '[email protected]', 'test@[127.0.0.1]' => 'test@[127.0.0.1]', '[email protected]' => '[email protected]');
     foreach ($data as $value => $expected) {
         $result = format_email($value);
         $this->assertEquals($expected, $result, "Invalid format_email() result for {$value}");
     }
 }
开发者ID:JotapePinheiro,项目名称:roundcubemail,代码行数:11,代码来源:Bootstrap.php


示例3: send_email

function send_email($info)
{
    $body = format_email($info, 'html');
    $body_plain_txt = format_email($info, 'txt');
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject('Please validate your email');
    $message->setFrom(array('[email protected]' => 'Cravatte Loïc'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    $message->addPart($body, 'text/html');
    $result = $mailer->send($message);
    return $result;
}
开发者ID:lwst,项目名称:mailinglist,代码行数:15,代码来源:functions.php


示例4: send_email

function send_email($info)
{
    //format each email
    $body = format_email($info, 'html');
    $body_plain_txt = format_email($info, 'txt');
    //setup the mailer
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject('パスワード再登録のお知らせ');
    $message->setFrom(array('[email protected]' => 'Site Name'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    //	$message ->addPart($body, 'text/html');
    $result = $mailer->send($message);
    return $result;
}
开发者ID:noriaki77,项目名称:PvsaEntry,代码行数:17,代码来源:functions.php


示例5: email

function email($to, $message, $subject = "Email from Your Website", $from = false)
{
    global $_josh;
    error_debug("<b>email </b> sending message to <i>" . $to . "</i> with subject " . $subject);
    $headers = "MIME-Version: 1.0" . $_josh["newline"];
    $headers .= "Content-type: text/html; charset=iso-8859-1" . $_josh["newline"];
    if (!$from) {
        if (isset($_josh["email_default"])) {
            $from = $_josh["email_default"];
        } else {
            error_handle("email from address missing", "please call this function with a from address, or specify one in the config file.", true);
        }
    }
    $to = format_email($to);
    $headers .= "From: " . format_email($from) . $_josh["newline"];
    if (!mail($to, $subject, $message, $headers)) {
        error_handle("email not sent", "sorry, an unexpected error occurred while sending your mail.", true);
    }
    return true;
}
开发者ID:joshreisner,项目名称:hcfa-cc,代码行数:20,代码来源:email.php


示例6: sendConfirmedEmail

/** ----------------------------------------------------------------------------
 * @param type $nickname
 * @param type $email
 * @param type $key
 * -----------------------------------------------------------------------------
 */
function sendConfirmedEmail($nickname, $firstname, $email)
{
    $template_php = true;
    if ($template_php) {
        $template_html = createConfirmTemplate('html');
        $template_txt = createConfirmTemplate('txt');
    } else {
        $filedir = 'master/ThreeScriptTools/src/mail/templates';
        $filename = 'register_template';
        $root = $_SERVER['DOCUMENT_ROOT'] . "/{$filedir}";
        $template_html = file_get_contents("{$root}/{$filename}.html");
        $template_txt = file_get_contents("{$root}/{$filename}.txt");
    }
    $info = array('nickname' => $nickname, 'firstname' => $firstname, 'email' => $email, 'html' => $template_html, 'txt' => $template_txt);
    $info["html"] = format_email($template_html, $info, "html");
    $info["txt"] = format_email($template_txt, $info, "txt");
    $res = send_email($info);
    if ($res) {
        echo "the email was sent to {$email}";
    } else {
        echo "the email wasn't sent to {$email}: '{$res}'";
    }
}
开发者ID:ThreeScript,项目名称:ThreeScriptTools,代码行数:29,代码来源:ts-auth-mail.php


示例7: format_email

<?php

include "../include.php";
if ($posting) {
    $_POST["email"] = format_email($_POST["email"]);
    $_POST["phone"] = format_phone($_POST["phone"]);
    //create request
    //todo ~ check whether staff already exists -- forward to password reset
    if ($id = db_grab("SELECT userID FROM intranet_users WHERE email = '" . $_POST["email"] . "' AND isActive = 1")) {
        url_change("account_exists.php");
    } elseif ($id = db_grab("SELECT id FROM users_requests WHERE email = '" . $_POST["email"] . "'")) {
        db_query("UPDATE users_requests SET\n\t\t\tfirstname = '" . $_POST["firstname"] . "', \n\t\t\tlastname = '" . $_POST["lastname"] . "',\n\t\t\tnickname = '" . $_POST["nickname"] . "',\n\t\t\ttitle = '" . $_POST["title"] . "',\n\t\t\tphone = '" . $_POST["phone"] . "',\n\t\t\temail = '" . $_POST["email"] . "',\n\t\t\tdepartmentID = '" . $_POST["departmentID"] . "',\n\t\t\tcorporationID = '" . $_POST["corporationID"] . "',\n\t\t\tofficeID = '" . $_POST["officeID"] . "',\n\t\t\tbio = '" . $_POST["bio"] . "',\n\t\t\tcreatedOn = GETDATE()\n\t\tWHERE email = '" . $_POST["email"] . "'");
        email_user($_josh["email_admin"], "Repeat Account Request", drawEmptyResult($_POST["firstname"] . " " . $_POST["lastname"] . ' is <a href="http://' . $request["host"] . '/staff/add_edit.php?requestID=' . $id . '">re-requesting an account</a>.'));
    } else {
        $id = db_query("INSERT INTO users_requests (\n\t\t\tfirstname, \n\t\t\tlastname,\n\t\t\tnickname,\n\t\t\ttitle,\n\t\t\tphone,\n\t\t\temail,\n\t\t\tdepartmentID,\n\t\t\tcorporationID,\n\t\t\tofficeID,\n\t\t\tbio,\n\t\t\tcreatedOn\n\t\t) VALUES (\n\t\t\t'" . $_POST["firstname"] . "', \n\t\t\t'" . $_POST["lastname"] . "',\n\t\t\t'" . $_POST["nickname"] . "',\n\t\t\t'" . $_POST["title"] . "',\n\t\t\t'" . $_POST["phone"] . "',\n\t\t\t'" . $_POST["email"] . "',\n\t\t\t" . $_POST["departmentID"] . ",\n\t\t\t" . $_POST["corporationID"] . ",\n\t\t\t" . $_POST["officeID"] . ",\n\t\t\t'" . $_POST["bio"] . "',\n\t\t\tGETDATE()\n\t\t)");
        //prepare email
        reset($_POST);
        $message = "";
        while (list($key, $value) = each($_POST)) {
            $message .= '<tr><td class="left">' . $key . '</td>';
            if ($key == "email") {
                $message .= '<td><a href="mailto:' . $value . '">' . $value . '</a></td></tr>';
            } elseif ($key == "departmentID") {
                $r = db_grab("SELECT departmentName FROM intranet_departments WHERE departmentID = " . $value);
                $message .= '<td>' . $r . '</td></tr>';
            } elseif ($key == "officeID") {
                $r = db_grab("SELECT name FROM intranet_offices WHERE id = " . $value);
                $message .= '<td>' . $r . '</td></tr>';
            } elseif ($key == "corporationID") {
                $message .= '<td>' . db_grab("SELECT description FROM organizations WHERE id = " . $value) . '</td></tr>';
            } elseif ($key == "Additional Info") {
开发者ID:joshreisner,项目名称:hcfa-cc,代码行数:31,代码来源:account_request.php


示例8: check_email

function check_email($value, $empty, &$params, &$form)
{
    global $db, $tpl, $tables;
    $rs = $db->Execute("SELECT `ID`, `TITLE`, `URL` FROM `{$tables['link']['name']}` WHERE `URL` = " . $db->qstr($form['URL']) . " OR `TITLE` = " . $db->qstr($form['TITLE']));
    $err['dir'] = array();
    while (!$rs->EOF) {
        if (strcasecmp($rs->Fields('URL'), $form['URL']) == 0) {
            $err['dir'][] = 'URL';
        }
        if (strcasecmp($rs->Fields('TITLE'), $form['TITLE']) == 0) {
            $err['dir'][] = 'TITLE';
        }
        $rs->MoveNext();
    }
    $rs = $db->Execute("SELECT * FROM `{$tables['email']['name']}` WHERE `URL` = " . $db->qstr($form['URL']) . " OR `TITLE` = " . $db->qstr($form['TITLE']) . " OR `EMAIL` = " . $db->qstr($form['EMAIL']));
    $err['email'] = array();
    while (!$rs->EOF) {
        $row = array('EMAIL' => htmlentities(format_email($rs->Fields('EMAIL'), $rs->Fields('NAME'))), 'TITLE' => $rs->Fields('TITLE'), 'URL' => $rs->Fields('URL'), 'DATE' => $rs->Fields('DATE_SENT'));
        if (strcasecmp($rs->Fields('EMAIL'), $form['EMAIL']) == 0) {
            $row['TYPE'] = 'EMAIL';
        }
        if (strcasecmp($rs->Fields('URL'), $form['URL']) == 0) {
            $row['TYPE'] = 'URL';
        }
        if (strcasecmp($rs->Fields('TITLE'), $form['TITLE']) == 0) {
            $row['TYPE'] = 'TITLE';
        }
        $err['email'][] = $row;
        $rs->MoveNext();
    }
    if (count($err['dir']) > 0 || count($err['email']) > 0) {
        $tpl->assign('email_send_errors', $err);
        return $_REQUEST['IGNORE'];
    }
    return 1;
}
开发者ID:smcaleer,项目名称:scriptmind-links,代码行数:36,代码来源:email_send_and_add_link.php


示例9: list_identities

 /**
  * Return a list of all identities linked with this user
  *
  * @param string $sql_add   Optional WHERE clauses
  * @param bool   $formatted Format identity email and name
  *
  * @return array List of identities
  */
 function list_identities($sql_add = '', $formatted = false)
 {
     $result = array();
     $sql_result = $this->db->query("SELECT * FROM " . $this->db->table_name('identities') . " WHERE del <> 1 AND user_id = ?" . ($sql_add ? " " . $sql_add : "") . " ORDER BY " . $this->db->quote_identifier('standard') . " DESC, " . $this->db->quote_identifier('name') . " ASC, " . $this->db->quote_identifier('email') . " ASC, " . $this->db->quote_identifier('identity_id') . " ASC", $this->ID);
     while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
         if ($formatted) {
             $ascii_email = format_email($sql_arr['email']);
             $utf8_email = format_email(rcube_utils::idn_to_utf8($ascii_email));
             $sql_arr['email_ascii'] = $ascii_email;
             $sql_arr['email'] = $utf8_email;
             $sql_arr['ident'] = format_email_recipient($ascii_email, $sql_arr['name']);
         }
         $result[] = $sql_arr;
     }
     return $result;
 }
开发者ID:alecchisi,项目名称:roundcubemail,代码行数:24,代码来源:rcube_user.php


示例10: begin_users_env_nbm

function begin_users_env_nbm($is_to_send_mail = false)
{
    global $user, $lang, $lang_info, $conf, $env_nbm;
    // Save $user, $lang_info and $lang arrays (include/user.inc.php has been executed)
    $env_nbm['save_user'] = $user;
    // Save current language to stack, necessary because $user change during NBM
    switch_lang_to($user['language']);
    $env_nbm['is_to_send_mail'] = $is_to_send_mail;
    if ($is_to_send_mail) {
        // Init mail configuration
        $env_nbm['email_format'] = get_str_email_format($conf['nbm_send_html_mail']);
        $env_nbm['send_as_name'] = (isset($conf['nbm_send_mail_as']) and !empty($conf['nbm_send_mail_as'])) ? $conf['nbm_send_mail_as'] : get_mail_sender_name();
        $env_nbm['send_as_mail_address'] = get_webmaster_mail_address();
        $env_nbm['send_as_mail_formated'] = format_email($env_nbm['send_as_name'], $env_nbm['send_as_mail_address']);
        // Init mail counter
        $env_nbm['error_on_mail_count'] = 0;
        $env_nbm['sent_mail_count'] = 0;
        // Save sendmail message info and error in the original language
        $env_nbm['msg_info'] = l10n('Mail sent to %s [%s].');
        $env_nbm['msg_error'] = l10n('Error when sending email to %s [%s].');
    }
}
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:22,代码来源:functions_notification_by_mail.inc.php


示例11: send_email

function send_email($info, $type)
{
    //format each email
    $body = format_email($info, 'html', $type);
    $body_plain_txt = format_email($info, 'txt', $type);
    //setup the mailer
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject($info['temat']);
    $message->setFrom(array('[email protected]' => 'wszechwiedzacy.pl'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    $message->addPart($body, 'text/html');
    $result = $mailer->send($message);
    return $result;
}
开发者ID:qmmr,项目名称:wszechwiedzacy,代码行数:17,代码来源:functions.php


示例12: format_email

<?php

$pageIsPublic = true;
include '../include.php';
if ($posting) {
    $_POST['email'] = format_email($_POST['email']);
    $_POST['phone'] = format_phone($_POST['phone']);
    format_post_nulls('departmentID, officeID');
    //create request
    //todo ~ check whether staff already exists -- forward to password reset
    if ($id = db_grab('SELECT id FROM users WHERE email = "' . $_POST['email'] . '" AND is_active = 1')) {
        url_change('account_exists.php');
    } elseif (getOption('requests') && ($id = db_grab('SELECT id FROM users_requests WHERE email = "' . $_POST['email'] . '"'))) {
        db_save('users_requests', $id);
        emailAdmins('Repeat Account Request', $_POST['firstname'] . ' ' . $_POST['lastname'] . ' is ' . draw_link(url_base() . '/staff/add_edit.php?requestID=' . $id, 're-requesting an account'));
    } else {
        if (getOption('requests')) {
            $id = db_save('users_requests');
            //if (getOption('channels')) db_checkboxes('email_prefs', 'requests_to_channels_prefs', 'request_id', 'channel_id', $id);
            $subject = 'New User Request';
            $link = url_base() . '/staff/add_edit.php?requestID=' . $id;
        } else {
            $id = db_save('users');
            if (getOption('channels')) {
                db_checkboxes('email_prefs', 'users_to_channels_prefs', 'user_id', 'channel_id', $id);
            }
            $subject = 'New User Registration';
            $link = url_base() . '/staff/add_edit.php?id=' . $id;
            emailInvite($id);
        }
        //prepare email
开发者ID:Rhenan,项目名称:intranet-1,代码行数:31,代码来源:account_request.php


示例13: email_invite

function email_invite($id, $email, $name)
{
    global $_josh, $user;
    $email = format_email($email);
    $message = '<tr><td class="text">
			Welcome ' . $name . '!  You can
			<a href="http://' . $_josh["request"]["host"] . '/login/password_reset.php?id=' . $id . '">log in to the Intranet now</a>.  
			The system will prompt you to pick a password and update your contact information.
			<br><br>
			If you run into problems, please ask <a href="mailto:' . $user["email"] . '">' . $user["full_name"] . '</a> for help.
			</td></tr>';
    email_user($email, "Intranet Login Information", $message);
}
开发者ID:joshreisner,项目名称:hcfa-cc,代码行数:13,代码来源:include.php


示例14: array

<?php

include '../include.php';
$emails = array('[email protected]', 'foo [at] bar', '[email protected];[email protected]');
$emails = db_array('SELECT email FROM users WHERE is_active = 1 ORDER BY email');
$good = $bad = array();
foreach ($emails as $e) {
    if (!($good[] = format_email($e))) {
        array_pop($good);
        $bad[] = $e;
    }
}
echo 'good emails:' . draw_list($good);
echo '<hr>bad emails:' . draw_list($bad);
//email($emails, 'this is some test content', 'this is a test');
开发者ID:Rhenan,项目名称:intranet-1,代码行数:15,代码来源:email.php


示例15: define

define("SITE_URL", "http://wszechwiedzacy.pl/");
define("LIB_PATH", SITE_ROOT . "includes");
require_once LIB_PATH . DS . "config.php";
require_once LIB_PATH . DS . "functions.php";
require_once LIB_PATH . DS . "database.php";
require_once LIB_PATH . DS . "question.php";
require_once SITE_ROOT . DS . "lib/swift_required.php";
$info = array('temat' => 'Aktualizacja do wersji beta 0.8', 'key' => '23');
$q = "SELECT user_name, email FROM users WHERE subscribed = 1 LIMIT 300";
$r = $db->query($q);
while ($row = mysql_fetch_assoc($r)) {
    $info['username'] = $row['user_name'];
    $info['email'] = $row['email'];
    //format each email
    $body = format_email($info, 'html', 'test');
    $body_plain_txt = format_email($info, 'txt', 'test');
    //setup the mailer
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject($info['temat']);
    $message->setFrom(array('[email protected]' => 'wszechwiedzacy.pl'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    $message->addPart($body, 'text/html');
    $result = $mailer->send($message);
    if ($result) {
        echo "<h2>Mail to " . $info['username'] . " was successfully sent!</h2>";
    } else {
        echo "Mail to " . $info['username'] . " was NOT sent!";
    }
开发者ID:qmmr,项目名称:wszechwiedzacy,代码行数:31,代码来源:testing.php


示例16: account_user

function account_user($uname)
{
    global $user, $theme;
    function module($name, $module, $username)
    {
        global $theme;
        if ($module["user"] && ($block = $module["user"]($username, "user", "view"))) {
            if ($block["content"]) {
                $theme->box($block["subject"], $block["content"]);
            }
        }
    }
    if ($user->id && $user->userid == $uname) {
        $output .= "<TABLE BORDER=\"0\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n";
        $output .= " <TR><TD ALIGN=\"right\"><B>" . t("Username") . ":</B></TD><TD>{$user->userid}</TD></TR>\n";
        $output .= " <TR><TD ALIGN=\"right\"><B>" . t("E-mail") . ":</B></TD><TD>" . format_email($user->fake_email) . "</A></TD></TR>\n";
        $output .= " <TR><TD ALIGN=\"right\"><B>" . t("Homepage") . ":</B></TD><TD>" . format_url($user->url) . "</TD></TR>\n";
        $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>" . t("Bio") . ":</B></TD><TD>" . check_output($user->bio) . "</TD></TR>\n";
        $output .= " <TR><TD ALIGN=\"right\" VALIGN=\"top\"><B>" . t("Signature") . ":</B></TD><TD>" . check_output($user->signature) . "</TD></TR>\n";
        $output .= "</TABLE>\n";
        // Display account information:
        $theme->header();
        $theme->box(t("Personal information"), $output);
        $theme->footer();
    } elseif ($uname && ($account = account_get_user($uname))) {
        $block1 .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\">\n";
        $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("Username") . ":</B></TD><TD>{$account->userid}</TD></TR>\n";
        $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("E-mail") . ":</B></TD><TD>" . format_email($account->fake_email) . "</TD></TR>\n";
        $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("Homepage") . ":</B></TD><TD>" . format_url($account->url) . "</TD></TR>\n";
        $block1 .= " <TR><TD ALIGN=\"right\"><B>" . t("Bio") . ":</B></TD><TD>" . check_output($account->bio) . "</TD></TR>\n";
        $block1 .= "</TABLE>\n";
        $result = db_query("SELECT c.cid, c.pid, c.lid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.lid WHERE u.userid = '{$uname}' AND s.status = 2 AND c.link = 'story' AND s.timestamp > " . (time() - 1209600) . " ORDER BY cid DESC LIMIT 10");
        while ($comment = db_fetch_object($result)) {
            $block2 .= "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\">\n";
            $block2 .= " <TR><TD ALIGN=\"right\"><B>" . t("Comment") . ":</B></TD><TD><A HREF=\"story.php?id={$comment->lid}&cid={$comment->cid}&pid={$comment->pid}#{$comment->cid}\">" . check_output($comment->subject) . "</A></TD></TR>\n";
            $block2 .= " <TR><TD ALIGN=\"right\"><B>" . t("Date") . ":</B></TD><TD>" . format_date($comment->timestamp) . "</TD></TR>\n";
            $block2 .= " <TR><TD ALIGN=\"right\"><B>" . t("Story") . ":</B></TD><TD><A HREF=\"story.php?id={$comment->lid}\">" . check_output($comment->story) . "</A></TD></TR>\n";
            $block2 .= "</TABLE>\n";
            $block2 .= "<P>\n";
            $comments++;
        }
        // Display account information:
        $theme->header();
        if ($block1) {
            $theme->box(strtr(t("%a's user information"), array("%a" => $uname)), $block1);
        }
        if ($block2) {
            $theme->box(strtr(t("%a has posted %b recently"), array("%a" => $uname, "%b" => format_plural($comments, "comment", "comments"))), $block2);
        }
        module_iterate("module", $uname);
        $theme->footer();
    } else {
        // Display login form:
        $theme->header();
        $theme->box(t("Create user account"), account_create());
        $theme->box(t("E-mail new password"), account_email());
        $theme->footer();
    }
}
开发者ID:phpepe,项目名称:drupal2,代码行数:59,代码来源:account.php


示例17: define

define("SITE_URL", "http://wszechwiedzacy.pl/");
define("LIB_PATH", SITE_ROOT . "includes");
require_once LIB_PATH . DS . "config.php";
require_once LIB_PATH . DS . "functions.php";
require_once LIB_PATH . DS . "database.php";
require_once LIB_PATH . DS . "question.php";
require_once SITE_ROOT . DS . "lib/swift_required.php";
$info = array('temat' => 'Aktualizacja do wersji beta 0.8');
$q = "SELECT user_name, email FROM users WHERE subscribed = 1 LIMIT 300";
$r = $db->query($q);
while ($row = mysql_fetch_assoc($r)) {
    $info['username'] = $row['user_name'];
    $info['email'] = $row['email'];
    //format each email
    $body = format_email($info, 'html', 'aktualizacja');
    $body_plain_txt = format_email($info, 'txt', 'aktualizacja');
    //setup the mailer
    $transport = Swift_MailTransport::newInstance();
    $mailer = Swift_Mailer::newInstance($transport);
    $message = Swift_Message::newInstance();
    $message->setSubject($info['temat']);
    $message->setFrom(array('[email protected]' => 'wszechwiedzacy.pl'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    $message->addPart($body, 'text/html');
    if ($mailer->send($message)) {
        echo "<h2>Mail to " . $info['username'] . " was successfully sent!</h2>";
    } else {
        echo "<h2>Mail to " . $info['username'] . " was NOT sent!</h2>";
    }
}
开发者ID:qmmr,项目名称:wszechwiedzacy,代码行数:31,代码来源:manual_email_send.php


示例18: mail

        $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
        $headers .= "Content-Transfer-Encoding: quoted-printable";
        mail($comments_address, $subject, $c_msg, $headers);
        if ($_POST['bakecookie'] == 'on') {
            setcookie("blogatron_author", "{$c_author}", time() + 3600 * 24 * 365, "/");
            setcookie("blogatron_email", "{$c_email}", time() + 3600 * 24 * 365, "/");
            setcookie("blogatron_url", "{$c_url}", time() + 3600 * 24 * 365, "/");
        }
        if ($_POST['bakecookie'] == 'off') {
            setcookie("blogatron_author", "", time() - 3600 * 24, "/");
            setcookie("blogatron_email", "", time() - 3600 * 24, "/");
            setcookie("blogatron_url", "", time() - 3600 * 24, "/");
        }
        $c_text = strip_tags($c_text, '<a><b><em><q><del>');
        $c_author = format_comment($c_author);
        $c_email = format_email($c_email);
        $c_url = format_url($c_url);
        $date = time() + $offset * 3600;
        $sql = "\n\t\t\tINSERT INTO comments set \n\t\t\tc_author = ('{$c_author}'),\n\t\t\tc_text = ('{$c_text}'),\n\t\t\tc_email = ('{$c_email}'),\n\t\t\tc_url = ('{$c_url}'),\n\t\t\tc_ip = ('{$c_ip}'),\n\t\t\tdate = ('{$date}'),\n\t\t\teid = ('{$eid}')";
        if (!($result = @mysql_query($sql))) {
            print "<p>Der skete en fejl: " . mysql_error() . "</p>";
            print "<p>{$sql}</p>";
        }
        header("Location: {$comment_url}#c");
    }
} else {
    print_header(". {$blog_title} | kukabuxilah .", "stil.css", $domain_name, $description, $key_words, $dc_title, $install_path);
    ?>
		<div id="container">
		   <div id="top">
		      <div id="banner2">
开发者ID:voss,项目名称:blogatron,代码行数:31,代码来源:opraab.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP format_error函数代码示例发布时间:2022-05-15
下一篇:
PHP format_descriptive_date函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap