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


PHP Mailer::set_address方法代码示例

本文整理汇总了PHP中Mailer::set_address方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::set_address方法的具体用法?PHP Mailer::set_address怎么用?PHP Mailer::set_address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mailer的用法示例。


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

示例1: unhtmlspecialchars

 if (preg_match('/[\\x80-\\x9F]/', $row['log_subject']) || preg_match('/[\\x80-\\x9F]/', $row['log_body_text']) || preg_match('/[\\x80-\\x9F]/', $row['log_body_html'])) {
     if (TRANSLITE_INVALID_CHARS == false) {
         $row['log_subject'] = wan_utf8_encode($row['log_subject']);
         $row['log_body_text'] = wan_utf8_encode($row['log_body_text']);
         $row['log_body_html'] = wan_utf8_encode($row['log_body_html']);
         $lang['Label_link'] = $lang['Label_link::utf8'];
         $mailer->set_charset('UTF-8');
     } else {
         $row['log_subject'] = purge_latin1($row['log_subject'], true);
         $row['log_body_text'] = purge_latin1($row['log_body_text'], true);
         $row['log_body_html'] = purge_latin1($row['log_body_html']);
     }
 }
 $mailer->clear_all();
 $mailer->set_from($listdata['sender_email'], unhtmlspecialchars($listdata['liste_name']));
 $mailer->set_address($address);
 $mailer->set_format($format);
 $mailer->set_subject($row['log_subject']);
 if ($listdata['return_email'] != '') {
     $mailer->set_return_path($listdata['return_email']);
 }
 if ($format == FORMAT_TEXTE) {
     $body = $row['log_body_text'];
 } else {
     $body = $row['log_body_html'];
 }
 //
 // Ajout du lien de désinscription, selon le format utilisé
 //
 if ($listdata['use_cron']) {
     $liste_email = !empty($listdata['liste_alias']) ? $listdata['liste_alias'] : $listdata['sender_email'];
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:31,代码来源:profil_cp.php

示例2: Mailer

        if (!($admin_id = $result->column('admin_id'))) {
            $error = TRUE;
            $msg_error[] = $lang['Message']['Error_sendpass'];
        }
        if (!$error) {
            $new_password = generate_key(12);
            require WAMAILER_DIR . '/class.mailer.php';
            $mailer = new Mailer(WA_ROOTDIR . '/language/email_' . $nl_config['language'] . '/');
            if ($nl_config['use_smtp']) {
                $mailer->smtp_path = WAMAILER_DIR . '/';
                $mailer->use_smtp($nl_config['smtp_host'], $nl_config['smtp_port'], $nl_config['smtp_user'], $nl_config['smtp_pass']);
            }
            $mailer->set_charset($lang['CHARSET']);
            $mailer->set_format(FORMAT_TEXTE);
            $mailer->set_from($email);
            $mailer->set_address($email);
            $mailer->set_subject($lang['Subject_email']['New_pass']);
            $mailer->use_template('new_admin_pass', array('PSEUDO' => $login, 'PASSWORD' => $new_password));
            if (!$mailer->send()) {
                trigger_error('Failed_sending', ERROR);
            }
            $db->query("UPDATE " . ADMIN_TABLE . "\n\t\t\t\tSET admin_pwd = '" . md5($new_password) . "'\n\t\t\t\tWHERE admin_id = " . $admin_id);
            $output->message('IDs_sended');
        }
    }
    $output->page_header();
    $output->set_filenames(array('body' => 'sendpass_body.tpl'));
    $output->assign_vars(array('TITLE' => $lang['Title']['sendpass'], 'L_LOGIN' => $lang['Login'], 'L_EMAIL' => $lang['Email_address'], 'L_VALID_BUTTON' => $lang['Button']['valid'], 'S_LOGIN' => htmlspecialchars($login), 'S_EMAIL' => htmlspecialchars($email)));
    $output->pparse('body');
    $output->page_footer();
} else {
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:31,代码来源:login.php

示例3: array


//.........这里部分代码省略.........
     if (!($result = $db->query($sql))) {
         trigger_error('Impossible d\'obtenir la liste des adresses emails', ERROR);
     }
     $abo_ids = array();
     $format = $listdata['liste_format'] != FORMAT_MULTIPLE ? $listdata['liste_format'] : false;
     if ($row = $result->fetch()) {
         if ($nl_config['engine_send'] == ENGINE_BCC) {
             fake_header(false);
             $abonnes = array(FORMAT_TEXTE => array(), FORMAT_HTML => array());
             $abo_ids = array(FORMAT_TEXTE => array(), FORMAT_HTML => array());
             do {
                 $abo_format = !$format ? $row['format'] : $format;
                 array_push($abo_ids[$abo_format], $row['abo_id']);
                 array_push($abonnes[$abo_format], $row['abo_email']);
                 fake_header(true);
             } while ($row = $result->fetch());
             if ($listdata['liste_format'] != FORMAT_HTML) {
                 $abonnes[FORMAT_TEXTE] = array_merge($abonnes[FORMAT_TEXTE], $supp_address);
             }
             if ($listdata['liste_format'] != FORMAT_TEXTE) {
                 $abonnes[FORMAT_HTML] = array_merge($abonnes[FORMAT_HTML], $supp_address);
             }
             //
             // Tableau pour remplacer les tags par des chaines vides
             // Non utilisation des tags avec le moteur d'envoi en copie cachée
             //
             $tags_replace = array('NAME' => '');
             if (count($other_tags) > 0) {
                 foreach ($other_tags as $data) {
                     $tags_replace[$data['tag_name']] = '';
                 }
             }
             if (count($abonnes[FORMAT_TEXTE]) > 0) {
                 $mailer->set_address($abonnes[FORMAT_TEXTE], 'Bcc');
                 $mailer->set_format(FORMAT_TEXTE);
                 $mailer->set_message($body[FORMAT_TEXTE]);
                 $mailer->assign_tags($tags_replace);
                 if (!$mailer->send()) {
                     trigger_error(sprintf($lang['Message']['Failed_sending2'], $mailer->msg_error), ERROR);
                 }
                 fwrite($fp, implode("\n", $abo_ids[FORMAT_TEXTE]) . "\n");
             }
             $mailer->clear_address();
             if (count($abonnes[FORMAT_HTML]) > 0) {
                 $mailer->set_address($abonnes[FORMAT_HTML], 'Bcc');
                 $mailer->set_format($listdata['liste_format']);
                 $mailer->assign_tags($tags_replace);
                 $mailer->set_message($body[FORMAT_HTML]);
                 if ($listdata['liste_format'] == FORMAT_MULTIPLE) {
                     $mailer->set_altmessage($body[FORMAT_TEXTE]);
                 }
                 if (!$mailer->send()) {
                     trigger_error(sprintf($lang['Message']['Failed_sending2'], $mailer->msg_error), ERROR);
                 }
                 fwrite($fp, implode("\n", $abo_ids[FORMAT_HTML]) . "\n");
             }
             $abo_ids = array_merge($abo_ids[FORMAT_TEXTE], $abo_ids[FORMAT_HTML]);
         } else {
             if ($nl_config['engine_send'] == ENGINE_UNIQ) {
                 if (defined('IN_COMMANDLINE')) {
                     require WA_ROOTDIR . '/contrib/Console/ProgressBar.php';
                     //
                     // Initialisation de la barre de progression des envois
                     //
                     $bar = new Console_ProgressBar('Sending emails %percent% [%bar%] %current% of %max%', '=>', ' ', 80, $total_abo + count($supp_address), array('ansi_terminal' => ANSI_TERMINAL));
                 } else {
开发者ID:bibwho,项目名称:MATPbootstrap,代码行数:67,代码来源:engine_send.php


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