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


PHP format_email函数代码示例

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


在下文中一共展示了format_email函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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('noreply@geomail.com' => 'Site Name'));
    $message->setTo(array($info['email'] => $info['username']));
    $message->setBody($body_plain_txt);
    $message->addPart($body, 'text/html');
    echo "WHAT";
    echo $message;
    //$to = "tepnimitl@gmail.com";
    //$sub = "Te_subject_of_your_email";
    //$mess = "Dear User, \r\n\r\n";
    //$mess .= "This is your message \r\n";
    //$headers = "From: noreply@.com \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', 'test@test.tld' => 'test@test.tld', 'test@[127.0.0.1]' => 'test@[127.0.0.1]', 'TEST@TEST.TLD' => 'TEST@test.tld');
     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('cravatteloic@gmail.com.com' => '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('noreply@sitename.com' => '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('kontakt@wszechwiedzacy.pl' => '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('josh@joshreisner.com', 'foo [at] bar', 'test@mweb.co.za;testest@clara.net');
$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('kontakt@wszechwiedzacy.pl' => '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


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