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


PHP PHPMailer::AddBcc方法代码示例

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


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

示例1: send

 public function send()
 {
     Yii::import('application.extensions.smtpmail.PHPMailer');
     $mail = new PHPMailer();
     $mail->IsSMTP();
     $mail->Host = Yii::app()->user->getSetting('company.mail.server');
     $mail->SMTPAuth = Yii::app()->user->getSetting('company.mail.user') != '' ? true : false;
     $mail->SMTPSecure = Yii::app()->user->getSetting('company.mail.ssl') ? 'tls' : '';
     $mail->CharSet = 'utf-8';
     $mail->Port = Yii::app()->user->getSetting('company.mail.port');
     $mail->Username = Yii::app()->user->getSetting('company.mail.user');
     $mail->Password = Yii::app()->user->getSetting('company.mail.password');
     //$mail->SetFrom($this->from);
     //echo $this->files;
     if ($this->files != '') {
         $file = Files::model()->findByPk($this->files);
         if ($file != null) {
             //echo $file->getFullPath().";;".$file->name;
             $mail->AddAttachment($file->getFullFilePath(), $file->name);
         }
     }
     $mail->SetFrom(Yii::app()->user->settings['company.mail.address']);
     $mail->AddCC($this->cc);
     //.$this->cc
     $mail->AddBcc($this->bcc);
     $mail->Subject = $this->subject;
     $mail->MsgHTML($this->body);
     $mail->AddAddress($this->to, "");
     if (!$mail->Send()) {
         //echo "Mailer Error: " . $mail->ErrorInfo;
         throw new CHttpException(501, Yii::t('app', "Mailer Error: ") . $mail->ErrorInfo . $mail->Username);
     } else {
         $this->sent++;
         $this->save();
         Yii::app()->user->setFlash('success', Yii::t('app', 'Message sent!'));
         //echo "Message sent!";
     }
     //*/
     //Yii::app()->end();
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:40,代码来源:Mail.php

示例2: array


//.........这里部分代码省略.........
     }
     // Set mail's subject and body
     $phpmailer->Subject = $subject;
     $phpmailer->Body = $message;
     // Add any CC and BCC recipients
     if (!empty($cc)) {
         foreach ((array) $cc as $recipient) {
             try {
                 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
                 $recipient_name = '';
                 if (preg_match('/(.*)<(.+)>/', $recipient, $matches)) {
                     if (count($matches) == 3) {
                         $recipient_name = $matches[1];
                         $recipient = $matches[2];
                     }
                 }
                 $phpmailer->AddCc($recipient, $recipient_name);
             } catch (phpmailerException $e) {
                 continue;
             }
         }
     }
     if (!empty($bcc)) {
         foreach ((array) $bcc as $recipient) {
             try {
                 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
                 $recipient_name = '';
                 if (preg_match('/(.*)<(.+)>/', $recipient, $matches)) {
                     if (count($matches) == 3) {
                         $recipient_name = $matches[1];
                         $recipient = $matches[2];
                     }
                 }
                 $phpmailer->AddBcc($recipient, $recipient_name);
             } catch (phpmailerException $e) {
                 continue;
             }
         }
     }
     // Set to use PHP's mail()
     $phpmailer->IsMail();
     // Set Content-Type and charset
     // If we don't have a content-type from the input headers
     if (!isset($content_type)) {
         $content_type = 'text/plain';
     }
     /**
      * Filter the wp_mail() content type.
      *
      * @since 2.3.0
      *
      * @param string $content_type Default wp_mail() content type.
      */
     $content_type = apply_filters('wp_mail_content_type', $content_type);
     $phpmailer->ContentType = $content_type;
     // Set whether it's plaintext, depending on $content_type
     if ('text/html' == $content_type) {
         $phpmailer->IsHTML(true);
     }
     // If we don't have a charset from the input headers
     if (!isset($charset)) {
         $charset = get_bloginfo('charset');
     }
     // Set the content-type and charset
     /**
      * Filter the default wp_mail() charset.
开发者ID:cybKIRA,项目名称:roverlink-updated,代码行数:67,代码来源:pluggable.php

示例3: foreach

            continue;
        }
    }
}
if (!empty($bcc)) {
    foreach ((array) $bcc as $recipient) {
        try {
            // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
            $recipient_name = '';
            if (preg_match('/(.*)<(.+)>/', $recipient, $matches)) {
                if (count($matches) == 3) {
                    $recipient_name = $matches[1];
                    $recipient = $matches[2];
                }
            }
            $phpmailer->AddBcc($recipient, $recipient_name);
        } catch (phpmailerException $e) {
            continue;
        }
    }
}
// Set to use PHP's mail()
$phpmailer->IsMail();
// Set Content-Type and charset
// If we don't have a content-type from the input headers
if (!isset($content_type)) {
    $content_type = 'text/plain';
}
$content_type = apply_filters('wp_mail_content_type', $content_type);
$phpmailer->ContentType = $content_type;
// Set whether it's plaintext, depending on $content_type
开发者ID:duongnguyen92,项目名称:tvd12v2,代码行数:31,代码来源:function.wp_mail.php

示例4: extract


//.........这里部分代码省略.........
                         $from_name = substr($content, 0, strpos($content, '<') - 1);
                         $from_name = str_replace('"', '', $from_name);
                         $from_name = trim($from_name);
                         $from_email = substr($content, strpos($content, '<') + 1);
                         $from_email = str_replace('>', '', $from_email);
                         $from_email = trim($from_email);
                     } else {
                         $from_name = trim($content);
                     }
                 } elseif ('content-type' == strtolower($name)) {
                     if (strpos($content, ';') !== false) {
                         list($type, $charset) = explode(';', $content);
                         $content_type = trim($type);
                         $charset = trim(str_replace(array('charset=', '"'), '', $charset));
                     } else {
                         $content_type = trim($content);
                     }
                 } elseif ('cc' == strtolower($name)) {
                     $cc = explode(",", $content);
                 } elseif ('bcc' == strtolower($name)) {
                     $bcc = explode(",", $content);
                 } else {
                     // Add it to our grand headers array
                     $headers[trim($name)] = trim($content);
                 }
             }
         }
     }
     // Empty out the values that may be set
     $phpmailer->ClearAddresses();
     $phpmailer->ClearAllRecipients();
     $phpmailer->ClearAttachments();
     $phpmailer->ClearBCCs();
     $phpmailer->ClearCCs();
     $phpmailer->ClearCustomHeaders();
     $phpmailer->ClearReplyTos();
     // From email and name
     // If we don't have a name from the input headers
     if (!isset($from_name)) {
         $from_name = 'WordPress';
     }
     // If we don't have an email from the input headers
     if (!isset($from_email)) {
         // Get the site domain and get rid of www.
         $sitename = strtolower($_SERVER['SERVER_NAME']);
         if (substr($sitename, 0, 4) == 'www.') {
             $sitename = substr($sitename, 4);
         }
         $from_email = 'wordpress@' . $sitename;
     }
     // Set the from name and email
     $phpmailer->From = apply_filters('wp_mail_from', $from_email);
     $phpmailer->FromName = apply_filters('wp_mail_from_name', $from_name);
     // Set destination address
     $phpmailer->AddAddress($to);
     // Set mail's subject and body
     $phpmailer->Subject = $subject;
     $phpmailer->Body = $message;
     // Add any CC and BCC recipients
     if (!empty($cc)) {
         foreach ($cc as $recipient) {
             $phpmailer->AddCc(trim($recipient));
         }
     }
     if (!empty($bcc)) {
         foreach ($bcc as $recipient) {
             $phpmailer->AddBcc(trim($recipient));
         }
     }
     // Set to use PHP's mail()
     $phpmailer->IsMail();
     // Set Content-Type and charset
     // If we don't have a content-type from the input headers
     if (!isset($content_type)) {
         $content_type = 'text/plain';
     }
     $content_type = apply_filters('wp_mail_content_type', $content_type);
     // Set whether it's plaintext or not, depending on $content_type
     if ($content_type == 'text/html') {
         $phpmailer->IsHTML(true);
     } else {
         $phpmailer->IsHTML(false);
     }
     // If we don't have a charset from the input headers
     if (!isset($charset)) {
         $charset = get_bloginfo('charset');
     }
     // Set the content-type and charset
     $phpmailer->CharSet = apply_filters('wp_mail_charset', $charset);
     // Set custom headers
     if (!empty($headers)) {
         foreach ($headers as $name => $content) {
             $phpmailer->AddCustomHeader(sprintf('%1$s: %2$s', $name, $content));
         }
     }
     do_action_ref_array('phpmailer_init', array(&$phpmailer));
     // Send!
     $result = @$phpmailer->Send();
     return $result;
 }
开发者ID:nurpax,项目名称:saastafi,代码行数:101,代码来源:pluggable.php

示例5: array


//.........这里部分代码省略.........
                             $boundary = trim(str_replace(array('BOUNDARY=', 'boundary=', '"'), '', $charset));
                             $charset = '';
                         }
                     } else {
                         $content_type = trim($content);
                     }
                 } elseif ('cc' == strtolower($name)) {
                     $cc = explode(",", $content);
                 } elseif ('bcc' == strtolower($name)) {
                     $bcc = explode(",", $content);
                 } else {
                     // Add it to our grand headers array
                     $headers[trim($name)] = trim($content);
                 }
             }
         }
     }
     // Empty out the values that may be set
     $bb_phpmailer->ClearAddresses();
     $bb_phpmailer->ClearAllRecipients();
     $bb_phpmailer->ClearAttachments();
     $bb_phpmailer->ClearBCCs();
     $bb_phpmailer->ClearCCs();
     $bb_phpmailer->ClearCustomHeaders();
     $bb_phpmailer->ClearReplyTos();
     // From email and name
     // If we don't have a name from the input headers
     if (!isset($from_name)) {
         $from_name = bb_get_option('name');
     }
     // If we don't have an email from the input headers
     if (!isset($from_email)) {
         $from_email = bb_get_option('from_email');
     }
     // If there is still no email address
     if (!$from_email) {
         // Get the site domain and get rid of www.
         $sitename = strtolower($_SERVER['SERVER_NAME']);
         if (substr($sitename, 0, 4) == 'www.') {
             $sitename = substr($sitename, 4);
         }
         $from_email = 'bbpress@' . $sitename;
     }
     // Plugin authors can override the potentially troublesome default
     $bb_phpmailer->From = apply_filters('bb_mail_from', $from_email);
     $bb_phpmailer->FromName = apply_filters('bb_mail_from_name', $from_name);
     // Set destination address
     $bb_phpmailer->AddAddress($to);
     // Set mail's subject and body
     $bb_phpmailer->Subject = $subject;
     $bb_phpmailer->Body = $message;
     // Add any CC and BCC recipients
     if (!empty($cc)) {
         foreach ((array) $cc as $recipient) {
             $bb_phpmailer->AddCc(trim($recipient));
         }
     }
     if (!empty($bcc)) {
         foreach ((array) $bcc as $recipient) {
             $bb_phpmailer->AddBcc(trim($recipient));
         }
     }
     // Set to use PHP's mail()
     $bb_phpmailer->IsMail();
     // Set Content-Type and charset
     // If we don't have a content-type from the input headers
     if (!isset($content_type)) {
         $content_type = 'text/plain';
     }
     $content_type = apply_filters('bb_mail_content_type', $content_type);
     $bb_phpmailer->ContentType = $content_type;
     // Set whether it's plaintext or not, depending on $content_type
     if ($content_type == 'text/html') {
         $bb_phpmailer->IsHTML(true);
     }
     // If we don't have a charset from the input headers
     if (!isset($charset)) {
         $charset = bb_get_option('charset');
     }
     // Set the content-type and charset
     $bb_phpmailer->CharSet = apply_filters('bb_mail_charset', $charset);
     // Set custom headers
     if (!empty($headers)) {
         foreach ((array) $headers as $name => $content) {
             $bb_phpmailer->AddCustomHeader(sprintf('%1$s: %2$s', $name, $content));
         }
         if (false !== stripos($content_type, 'multipart') && !empty($boundary)) {
             $bb_phpmailer->AddCustomHeader(sprintf("Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary));
         }
     }
     if (!empty($attachments)) {
         foreach ($attachments as $attachment) {
             $bb_phpmailer->AddAttachment($attachment);
         }
     }
     do_action_ref_array('bb_phpmailer_init', array(&$bb_phpmailer));
     // Send!
     $result = @$bb_phpmailer->Send();
     return $result;
 }
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:101,代码来源:functions.bb-pluggable.php

示例6: mail_it


//.........这里部分代码省略.........
            }
            if (isset($_POST['SMTPAuth']) && ($_POST['SMTPAuth'] === true || $_POST['SMTPAuth'] === false)) {
                $mail->SMTPAuth = $_POST['SMTPAuth'];
            }
            if (isset($_POST['Username']) && trim($_POST['Username']) != "") {
                $mail->Username = trim($_POST['Username']);
            }
            if (isset($_POST['Username']) && trim($_POST['Username']) != "") {
                $mail->Password = trim($_POST['Password']);
            }
            if (isset($_POST['Timeout']) && trim($_POST['Timeout']) != "") {
                $mail->Timeout = trim($_POST['Timeout']);
            }
        } elseif (isset($_POST['Mailer']) && strtolower(trim($_POST['Mailer'])) == "sendmail") {
            $mail->IsSendmail();
        } elseif (isset($_POST['Mailer']) && strtolower(trim($_POST['Mailer'])) == "qmail") {
            $mail->IsQmail();
        }
        if (isset($_POST['fixedFromEmail'])) {
            if (isset($_POST['fixedFromName']) && trim($_POST['fixedFromName']) == '') {
                $_POST['fixedFromName'] = $_POST['fixedFromEmail'];
            }
            if (stristr($mail->Version, '5.1')) {
                $mail->SetFrom($_POST['fixedFromEmail'], $_POST['fixedFromName']);
            } elseif (stristr($mail->Version, '5')) {
                $mail->SetFrom($_POST['fixedFromEmail'], $_POST['fixedFromName']);
                $mail->AddReplyTo($_POST['fixedFromEmail'], $_POST['fixedFromName']);
            } else {
                $mail->SetFrom($_POST['fixedFromEmail'], $_POST['fixedFromName']);
            }
        } else {
            if (!isset($realname) && trim($realname) == '') {
                $realname = $email;
            }
            if (stristr($mail->Version, '5.1')) {
                $mail->SetFrom($email, $realname);
            } elseif ($mail->Version >= 5) {
                $mail->SetFrom($email, $realname);
                $mail->AddReplyTo($email, $realname);
            } else {
                $mail->From = $email;
                $mail->FromName = $realname;
            }
        }
        $mail->Subject = $subject;
        $mail->AddAddress($recipient);
        if ($bcc) {
            if (strpos($bcc, ",") || strpos($bcc, ";")) {
                $bcc_in = explode(',', $bcc);
                foreach ($bcc_in as $key => $value) {
                    $mail->AddBcc($value);
                }
            } else {
                $mail->AddBcc($bcc);
            }
        }
        if ($cc) {
            if (strpos($cc, ",") || strpos($cc, ";")) {
                $cc_in = explode(',', $cc);
                foreach ($cc_in as $key => $value) {
                    $mail->AddCc($value);
                }
            } else {
                $mail->AddCc($cc);
            }
        }
        $mail->MsgHTML($content["html"]);
        $mail->AltBody = _html2txt($content['html']);
        if ($attachment_name && $inbound) {
            //Add attachment function is in phpmailer
            //reset the arrays to the top
            reset($attachment_name);
            reset($attachment_temp);
            //loop through the arrays to get the attached file names and attach each one.
            while ((list($key1, $val1) = each($attachment_name)) && (list($key2, $val2) = each($attachment_temp))) {
                $atchmnt = file_get_contents($val2);
                $mail->AddStringAttachment($atchmnt, $val1);
            }
        } else {
            if ($local_name && $inbound === false) {
                $mail->AddAttachment($local_temp, $local_name);
            }
        }
        if ($mail->Send()) {
            echo '<script type="text/javascript">document.getElementById("feprocessing").src="_src/complete.gif";</script>';
            $valSent = true;
        }
    } else {
        if (@mail($recipient, $subject, $mail_message, $mail_headers)) {
            echo '<script type="text/javascript">document.getElementById("feprocessing").src="_src/complete.gif";</script>';
            $valSent = true;
        }
    }
    if ($addToCSV) {
        $writeVal = _writeLine($subject, $content['csv']);
    }
    if ($valSent) {
        return true;
    }
}
开发者ID:VicenteTerra,项目名称:validarec,代码行数:101,代码来源:phpmailer-fe.php

示例7: array


//.........这里部分代码省略.........
     $phpmailer->ClearReplyTos();
     // From email and name
     // If we don't have a name from the input headers
     if (!isset($from_name)) {
         $from_name = 'WordPress';
     }
     /* If we don't have an email from the input headers default to wordpress@$sitename
      * Some hosts will block outgoing mail from this address if it doesn't exist but
      * there's no easy alternative. Defaulting to admin_email might appear to be another
      * option but some hosts may refuse to relay mail from an unknown domain. See
      * http://trac.wordpress.org/ticket/5007.
      */
     if (!isset($from_email)) {
         // Get the site domain and get rid of www.
         $sitename = strtolower($_SERVER['SERVER_NAME']);
         if (substr($sitename, 0, 4) == 'www.') {
             $sitename = substr($sitename, 4);
         }
         $from_email = 'wordpress@' . $sitename;
     }
     // Plugin authors can override the potentially troublesome default
     $phpmailer->From = apply_filters('wp_mail_from', $from_email);
     $phpmailer->FromName = apply_filters('wp_mail_from_name', $from_name);
     // Set destination addresses
     if (!is_array($to)) {
         $to = explode(',', $to);
     }
     foreach ((array) $to as $recipient) {
         $phpmailer->AddAddress(trim($recipient));
     }
     // Set mail's subject and body
     $phpmailer->Subject = $subject;
     $phpmailer->Body = $message;
     // Add any CC and BCC recipients
     if (!empty($cc)) {
         foreach ((array) $cc as $recipient) {
             $phpmailer->AddCc(trim($recipient));
         }
     }
     if (!empty($bcc)) {
         foreach ((array) $bcc as $recipient) {
             $phpmailer->AddBcc(trim($recipient));
         }
     }
     if (!empty($message_id)) {
         $phpmailer->MessageID = $message_id;
     }
     // Set to use PHP's mail()
     $phpmailer->IsMail();
     // SupportPress: use STMP if configured
     if (defined('SMTP_HOST') && SMTP_HOST) {
         $phpmailer->IsSMTP();
         $phpmailer->Host = SMTP_HOST;
         if (SMTP_PORT) {
             $phpmailer->Host .= ':' . SMTP_PORT;
         }
         global $email_domain;
         $phpmailer->Hostname = $email_domain;
         if (SMTP_USER) {
             $phpmailer->SMTPAuth = true;
             $phpmailer->Username = SMTP_USER;
             $phpmailer->Password = SMTP_PASSWORD;
         }
     }
     // Set Content-Type and charset
     // If we don't have a content-type from the input headers
     if (!isset($content_type)) {
         $content_type = 'text/plain';
     }
     $content_type = apply_filters('wp_mail_content_type', $content_type);
     $phpmailer->ContentType = $content_type;
     // Set whether it's plaintext, depending on $content_type
     if ('text/html' == $content_type) {
         $phpmailer->IsHTML(true);
     }
     // If we don't have a charset from the input headers
     if (!isset($charset)) {
         $charset = 'utf-8';
     }
     // Set the content-type and charset
     $phpmailer->CharSet = apply_filters('wp_mail_charset', $charset);
     // Set custom headers
     if (!empty($headers)) {
         foreach ((array) $headers as $name => $content) {
             $phpmailer->AddCustomHeader(sprintf('%1$s: %2$s', $name, $content));
         }
         if (false !== stripos($content_type, 'multipart') && !empty($boundary)) {
             $phpmailer->AddCustomHeader(sprintf("Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary));
         }
     }
     if (!empty($attachments)) {
         foreach ($attachments as $attachment) {
             $phpmailer->AddAttachment($attachment);
         }
     }
     do_action_ref_array('phpmailer_init', array(&$phpmailer));
     // Send!
     $result = @$phpmailer->Send();
     return $result;
 }
开发者ID:bi0xid,项目名称:bach,代码行数:101,代码来源:wp-functions.php

示例8: enviarEmailSimples

function enviarEmailSimples($conteudo_email, $subject, $toEmail, $toUsuario, $fromEmail, $fromUsuario)
{
    //envia um email pela conta igccsp2015@gmail.com é preciso que a classe phpmailer esteja instalada - vale dar uma revisada geral
    require_once '../include/phpmailer/class.phpmailer.php';
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
    $mail = new PHPMailer(true);
    // the true param means it will throw exceptions on errors, which we need to catch
    $mail->IsSMTP();
    // telling the class to use SMTP
    try {
        //$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
        $mail->CharSet = 'UTF-8';
        $mail->SMTPAuth = true;
        // enable SMTP authentication
        $mail->SMTPSecure = "ssl";
        // sets the prefix to the servier
        $mail->Host = "smtp.gmail.com";
        // sets GMAIL as the SMTP server
        $mail->Port = 465;
        // set the SMTP port for the GMAIL server
        $mail->Username = "igccsp2015@gmail.com";
        // GMAIL username
        $mail->Password = "lic54eca";
        // GMAIL password
        $mail->AddAddress($toEmail, $toUsuario);
        $mail->AddBcc("igccsp2015@gmail.com");
        //hidden copy to igcssp2015
        //$mail->AddAddress(emailUserLogin($logado), nomeUserLogin($logado));
        $mail->SetFrom($fromEmail, $fromUsuario);
        $mail->AddReplyTo($fromEmail, $fromUsuario);
        //assunto da IGCCSP
        $mail->Subject = $subject;
        $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
        // optional - MsgHTML will create an alternate automatically
        //	Criar uma variável com as informações
        $mail->MsgHTML($conteudo_email);
        $mail->Send();
    } catch (phpmailerException $e) {
        echo $e->errorMessage();
        //Pretty error messages from PHPMailer
    } catch (Exception $e) {
        echo $e->getMessage();
        //Boring error messages from anything else!
    }
}
开发者ID:grayce1220,项目名称:igsis,代码行数:45,代码来源:funcoesGerais2.php

示例9: welcomeEmail

function welcomeEmail($values = [])
{
    require_once '../PHPMailer-master/class.phpmailer.php';
    require_once '../PHPMailer-master/class.smtp.php';
    extract($values);
    $mail = new PHPMailer();
    $mail->IsSMTP();
    // telling the class to use SMTP
    $mail->SMTPAuth = true;
    // enable SMTP authentication
    $mail->Host = "ssl://smtp.gmail.com";
    // sets the SMTP server
    $mail->Port = 465;
    // set the SMTP port for the GMAIL server
    $mail->Username = "cs50finance.jr@gmail.com";
    // SMTP account username
    $mail->Password = EMAIL_PASSWORD;
    // SMTP account password
    $mail->SetFrom('cs50finance.jr@gmail.com', 'JR\'s CS50 Finance');
    $mail->AddReplyTo("cs50finance.jr@gmail.com", "JR's CS50 Finance");
    $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
    // optional, comment out and test
    $mail->AddAddress($email, "");
    $mail->AddBcc("cs50finance.jr@gmail.com", "");
    $mail->Subject = "Welcome to JR's C\$50 Finance, " . $username . "!";
    $mail->MsgHTML(file_get_contents("../templates/welcome-email.html"));
    $mail->Send();
}
开发者ID:jayrav13,项目名称:cs50,代码行数:28,代码来源:functions.php

示例10: array


//.........这里部分代码省略.........
     // If we don't have a charset from the input headers
     if (!isset($charset)) {
         $charset = get_bloginfo('charset');
     }
     // Set the content-type and charset
     $phpmailer->CharSet = apply_filters('wp_mail_charset', $charset);
     // Set mail's subject and body
     $phpmailer->Subject = $subject;
     if (is_string($message)) {
         $phpmailer->Body = $message;
         // Set Content-Type and charset
         // If we don't have a content-type from the input headers
         if (!isset($content_type)) {
             $content_type = 'text/plain';
         }
         $content_type = apply_filters('wp_mail_content_type', $content_type);
         $phpmailer->ContentType = $content_type;
         // Set whether it's plaintext, depending on $content_type
         if ('text/html' == $content_type) {
             $phpmailer->IsHTML(true);
         }
         // For backwards compatibility, new multipart emails should use
         // the array style $message. This never really worked well anyway
         if (false !== stripos($content_type, 'multipart') && !empty($boundary)) {
             $phpmailer->AddCustomHeader(sprintf("Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary));
         }
     } elseif (is_array($message)) {
         foreach ($message as $type => $bodies) {
             foreach ((array) $bodies as $body) {
                 if ($type === 'text/html') {
                     $phpmailer->Body = $body;
                 } elseif ($type === 'text/plain') {
                     $phpmailer->AltBody = $body;
                 } else {
                     $phpmailer->AddAttachment($body, '', 'base64', $type);
                 }
             }
         }
     }
     // Add any CC and BCC recipients
     if (!empty($cc)) {
         foreach ((array) $cc as $recipient) {
             try {
                 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
                 $recipient_name = '';
                 if (preg_match('/(.+)\\s?<(.+)>/', $recipient, $matches)) {
                     if (count($matches) == 3) {
                         $recipient_name = $matches[1];
                         $recipient = $matches[2];
                     }
                 }
                 $phpmailer->AddCc(trim($recipient), $recipient_name);
             } catch (phpmailerException $e) {
                 continue;
             }
         }
     }
     if (!empty($bcc)) {
         foreach ((array) $bcc as $recipient) {
             try {
                 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
                 $recipient_name = '';
                 if (preg_match('/(.+)\\s?<(.+)>/', $recipient, $matches)) {
                     if (count($matches) == 3) {
                         $recipient_name = $matches[1];
                         $recipient = $matches[2];
                     }
                 }
                 $phpmailer->AddBcc(trim($recipient), $recipient_name);
             } catch (phpmailerException $e) {
                 continue;
             }
         }
     }
     // Set to use PHP's mail()
     $phpmailer->IsMail();
     // Set custom headers
     if (!empty($headers)) {
         foreach ((array) $headers as $name => $content) {
             $phpmailer->AddCustomHeader(sprintf('%1$s: %2$s', $name, $content));
         }
     }
     if (!empty($attachments)) {
         foreach ($attachments as $attachment) {
             try {
                 $phpmailer->AddAttachment($attachment);
             } catch (phpmailerException $e) {
                 continue;
             }
         }
     }
     do_action_ref_array('phpmailer_init', array(&$phpmailer));
     // Send!
     try {
         $phpmailer->Send();
     } catch (phpmailerException $e) {
         return false;
     }
     return true;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:101,代码来源:wp_mail.php

示例11: cartClose

 private function cartClose()
 {
     $this->load->model('UserModel', 'UserM');
     $this->UserM->idUser = $this->Data->idUser;
     if (!$this->cartShipping()) {
         return;
     }
     $this->session->unset_userdata('cart-ok-amout');
     $this->load->library('PHPMailer');
     $this->session->unset_userdata('cart-ok');
     $mail = new PHPMailer();
     $mail->From = $this->config->item('client-mail', 'app');
     $mail->FromName = $this->config->item('client', 'app');
     $this->data['fdata'] = $this->Cart->DataJsonCart($this->Cart->id);
     $this->data['cdata'] = $this->Cart->DataCartComplete($this->Cart->id);
     $this->data['cartItems'] = $this->Cart->ListItems();
     $mail->AddAddress($this->data['fdata']['mail']);
     $mail->IsHTML(true);
     $this->load->helper('date');
     $mensaje = $this->load->view('cart/mail', $this->data, true);
     $mail->Subject = 'Pedido ' . str_pad($this->data['cdata']->code, 6, "0", STR_PAD_LEFT);
     $mail->Body = $mensaje;
     @$mail->Send();
     $mail = new PHPMailer();
     $mail->From = $this->config->item('client-mail', 'app');
     $mail->FromName = $this->config->item('client', 'app');
     $mail->AddAddress('hola@anaangulo.com');
     $mail->AddBcc('juan@identty.com');
     $mail->AddBcc('antonio@identty.com');
     $mail->IsHTML(true);
     $this->load->helper('date');
     $mail->Subject = 'Pedido ' . str_pad($this->data['cdata']->code, 6, "0", STR_PAD_LEFT);
     $mail->Body = $mensaje;
     $mail->AddAttachment(FCPATH . "pdf/{$this->Cart->id}.pdf", 'Etiquetas_Zeleris.pdf');
     @$mail->Send();
     $this->Cart->CouponRegister($this->data['cdata']->coupon_1);
     $this->Cart->EndCart();
     return redirect('cart/finalizado');
 }
开发者ID:juanazareno,项目名称:entreambos,代码行数:39,代码来源:cart.php

示例12: while

 $mail->Host = "mail.bnu.edu.cn";
 // sets the SMTP server
 $mail->Port = 25;
 // set the SMTP port for the GMAIL server
 $mail->Username = "user";
 // SMTP account username
 $mail->Password = "pass";
 // SMTP account password
 $mail->CharSet = "UTF-8";
 $mail->SetFrom('addr', 'BNUCPC');
 $mail->Subject = $title;
 $mail->Body = $content;
 $cnt = 1;
 while ($row = mysql_fetch_array($res)) {
     $address = $row['mailaddress'];
     $mail->AddBcc($address, $row["realname"]);
     $cnt++;
     if ($cnt % 60 == 0) {
         if (!$mail->Send()) {
             echo "<p>发送失败!</p>\n";
         } else {
             echo "<p>发送成功!</p>\n";
         }
         $mail->ClearAddresses();
     }
 }
 if ($cnt % 60 != 0) {
     if (!$mail->Send()) {
         echo "<p>发送失败!</p>\n";
     } else {
         echo "<p>发送成功!</p>\n";
开发者ID:KinKir,项目名称:bnucpc,代码行数:31,代码来源:deal_mailall.php

示例13: bp_email

 /**
  * Send email(s).
  *
  * @since 2.5.0
  *
  * @param BP_Email $email Email to send.
  * @return bool|WP_Error Returns true if email send, else a descriptive WP_Error.
  */
 public function bp_email(BP_Email $email)
 {
     static $phpmailer = null;
     if ($phpmailer === null) {
         if (!class_exists('PHPMailer')) {
             require_once ABSPATH . WPINC . '/class-phpmailer.php';
             require_once ABSPATH . WPINC . '/class-smtp.php';
         }
         $phpmailer = new PHPMailer(true);
     }
     /*
      * Resets.
      */
     $phpmailer->clearAllRecipients();
     $phpmailer->clearAttachments();
     $phpmailer->clearCustomHeaders();
     $phpmailer->clearReplyTos();
     $phpmailer->Sender = '';
     /*
      * Set up.
      */
     $phpmailer->IsMail();
     $phpmailer->CharSet = bp_get_option('blog_charset');
     $phpmailer->Hostname = self::get_hostname();
     /*
      * Content.
      */
     $phpmailer->Subject = $email->get_subject('replace-tokens');
     $content_plaintext = PHPMailer::normalizeBreaks($email->get_content_plaintext('replace-tokens'));
     if ($email->get('content_type') === 'html') {
         $phpmailer->msgHTML($email->get_template('add-content'), '', 'wp_strip_all_tags');
         $phpmailer->AltBody = $content_plaintext;
     } else {
         $phpmailer->IsHTML(false);
         $phpmailer->Body = $content_plaintext;
     }
     $recipient = $email->get_from();
     try {
         $phpmailer->SetFrom($recipient->get_address(), $recipient->get_name(), false);
     } catch (phpmailerException $e) {
     }
     $recipient = $email->get_reply_to();
     try {
         $phpmailer->addReplyTo($recipient->get_address(), $recipient->get_name());
     } catch (phpmailerException $e) {
     }
     $recipients = $email->get_to();
     foreach ($recipients as $recipient) {
         try {
             $phpmailer->AddAddress($recipient->get_address(), $recipient->get_name());
         } catch (phpmailerException $e) {
         }
     }
     $recipients = $email->get_cc();
     foreach ($recipients as $recipient) {
         try {
             $phpmailer->AddCc($recipient->get_address(), $recipient->get_name());
         } catch (phpmailerException $e) {
         }
     }
     $recipients = $email->get_bcc();
     foreach ($recipients as $recipient) {
         try {
             $phpmailer->AddBcc($recipient->get_address(), $recipient->get_name());
         } catch (phpmailerException $e) {
         }
     }
     $headers = $email->get_headers();
     foreach ($headers as $name => $content) {
         $phpmailer->AddCustomHeader($name, $content);
     }
     /**
      * Fires after PHPMailer is initialised.
      *
      * @since 2.5.0
      *
      * @param PHPMailer $phpmailer The PHPMailer instance.
      */
     do_action('bp_phpmailer_init', $phpmailer);
     /** This filter is documented in wp-includes/pluggable.php */
     do_action_ref_array('phpmailer_init', array(&$phpmailer));
     try {
         return $phpmailer->Send();
     } catch (phpmailerException $e) {
         return new WP_Error($e->getCode(), $e->getMessage(), $email);
     }
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:95,代码来源:class-bp-phpmailer.php

示例14: date

<?php

if (isset($_POST['name']) && isset($_POST['lastname']) && isset($_POST['privacy']) && isset($_POST['mail']) && strlen($_POST['name']) > 3 && strlen($_POST['lastname']) > 3 && strlen($_POST['mail']) > 3) {
    $baseurl = 'https://anaangulo.com/';
    $layout = 'https://anaangulo.com/fb/';
    include_once 'PHPMailer.php';
    $date = date('d-m-Y H:i:s');
    $mail = new PHPMailer();
    $mail->From = 'hola@anaangulo.com';
    $mail->FromName = 'Ana Angulo';
    $mail->AddAddress($_POST['mail']);
    $mail->AddBcc('hola@anaangulo.com');
    $mail->AddBcc('antonio@identty.com');
    $mail->AddBcc('juan@identty.com');
    $mail->IsHTML(true);
    $mail->Subject = 'Suscripción Ana Angulo';
    $mail->Body = "<head></head>\n<body style='padding:0;margin:0'>\n  <table style='width:600px;margin:auto;border:0;border-spacing:0;border-collapse:collapse'>\n  <tr>\n    <td style='vertical-align:top'><a href='{$baseurl}' target='_blank'><img src='{$layout}mail/cabecera.jpg'></a></td>\n  </tr>\n  <tr>\n    <td style='vertical-align:top'><a href='{$baseurl}' target='_blank'><img src='{$layout}mail/link.png'></a></td>\n  </tr>\n  <tr>\n    <td style='vertical-align:top;text-align:center'><a href='{$baseurl}' target='_blank'><img alt='' src='{$layout}mail/texta.png'></a></td>\n  </tr>\n  <tr>\n    <td style='vertical-align:top;font-family:Arial, sans-serif; padding:15px 0; text-align:center;font-size:30px'>NEWS201544</td>\n  </tr>\n  <tr>\n    <td style='vertical-align:top;text-align:center'><a href='{$baseurl}' target='_blank'><img alt='' src='{$layout}mail/textb.png'></a></td>\n  </tr>\n  <tr>\n    <td style='vertical-align:top;    background-color: #7D7D7D;text-align:center'>\n        <br><a href='{$baseurl}' target='_blank'><img src='{$layout}mail/text2.png'></a><br>\n        <a href='{$baseurl}informacion/ana-angulo' target='_blank'><img alt='No respondas a este email ya que no podremos atenderte. Si tienes alguna pregunta o duda haz clic aquí para visitar nuestra página de Ayuda. ' src='{$layout}mail/text3.png'></a><br>\n        <a href='{$baseurl}' target='_blank'><img src='{$layout}mail/text4.png'></a><br><br>\n        <a style='margin-right:15px' href='https://www.facebook.com/tiendasanaangulo' target='_blank'><img src='{$layout}mail/facebook.jpg'></a> <a href='https://instagram.com/anaanguloboutique' target='_blank'><img src='{$layout}mail/instagram.jpg'></a><br><br>\n    </td>\n  </tr>\n  </table>\n</body>";
    @$mail->Send();
    $formOk = true;
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
  <meta charset="utf-8">
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-language" content="es" />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
  <title>Ana Angulo</title>
开发者ID:juanazareno,项目名称:ananagulo,代码行数:31,代码来源:index.php

示例15: contactAction

 function contactAction()
 {
     $muser = new Default_Model_System();
     $conten = $muser->list_system();
     $this->view->book = $conten;
     $captcha = new Zend_Captcha_Image();
     $vi = new Zend_View();
     $base = $vi->baseUrl();
     if (!$this->_request->isPost()) {
         $captcha->setTimeout('300')->setWordLen('4')->setHeight('50')->setWidth('200')->setImgDir(APPLICATION_PATH . '/../captcha/images/')->setImgUrl($base . '/captcha/images/')->setFont(APPLICATION_PATH . '/../font/UTM-Avo.ttf');
         $captcha->generate();
         $this->view->captcha = $captcha->render($this->view);
         $this->view->captchaID = $captcha->getId();
         // Dua chuoi Captcha vao session
         $captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captcha->getId());
         $captchaSession->word = $captcha->getWord();
     } else {
         $captchaID = $this->_request->captcha_id;
         $captchaSession = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captchaID);
         $captchaIterator = $captchaSession->getIterator();
         $captchaWord = $captchaIterator['word'];
         if ($this->_request->captcha == $captchaWord) {
             $this->view->purifier = Zend_Registry::get('purifier');
             $conf = HTMLPurifier_Config::createDefault();
             $purifier = new HTMLPurifier($conf);
             $fullname = $purifier->purify($this->_request->getParam('fullname'));
             $address = $purifier->purify($this->_request->getParam('address'));
             $phone = $purifier->purify($this->_request->getParam('phone'));
             $email = $purifier->purify($this->_request->getParam('email'));
             $content = $purifier->purify($this->_request->getParam('content'));
             $title = $purifier->purify($this->_request->getParam('title'));
             $emaillh = $conten[0]['email'];
             $tinnhan = "\n\t\t\tHọ tên : {$fullname} <br>\n\t\t\tEmail : {$email}<br>\n\t\t\tĐịa chỉ : {$address}<br>\n\t\t\tĐiện thoại : {$phone}<br>\n\t\t\t\n\t\t\tNội dung : {$content}<br>";
             require 'ham/class.phpmailer.php';
             require 'ham/class.pop3.php';
             // nạp thư viện
             $mail = new PHPMailer();
             // khởi tạo đối tượng
             $mail->IsSMTP();
             // gọi class smtp để đăng nhập
             $mail->CharSet = "utf-8";
             // bảng mã unicode
             //Đăng nhập Gmail
             $mail->SMTPAuth = true;
             // Đăng nhập
             $mail->SMTPSecure = "ssl";
             // Giao thức SSL
             $mail->Host = "smtp.gmail.com";
             // SMTP của GMAIL
             $mail->Port = 465;
             // cổng SMTP
             // Phải chỉnh sửa lại
             $mail->Username = "dadichvu.88@gmail.com";
             // GMAIL username
             $mail->Password = "itwebsite";
             // GMAIL password
             $mail->Subject = 'Thông tin liên hệ';
             $mail->AddAddress("{$emaillh}");
             //email người nhận
             $mail->AddBcc("lynguyetvan88@gmail.com");
             // Chuẩn bị gửi thư nào
             $mail->FromName = mb_convert_encoding($fullname, "UTF-8", "auto");
             // tên người gửi
             $mail->From = "{$email}";
             // mail người gửi
             $mail->IsHTML(true);
             //Bật HTML không thích thì false
             // Nội dung lá thư
             $mail->Body = "{$tinnhan}";
             // Gửi email
             if ($mail->Send()) {
                 // Gửi không được, đưa ra thông báo lỗi
                 $muser->contact($fullname, $address, $phone, $email, $title, $content);
                 thongbao("Cảm ơn bạn đã liên hệ cho chúng tôi");
                 trangtruoc();
             } else {
                 echo "Không gửi được ";
                 echo "Lỗi: " . $mail->ErrorInfo;
             }
         } else {
             thongbao('Bạn nhập sai chuỗi Captcha');
             trang_truoc();
         }
         $this->_helper->viewRenderer->setNoRender();
         $mask = APPLICATION_PATH . "/../captcha/images/*.png";
         array_map("unlink", glob($mask));
     }
 }
开发者ID:lynguyetvan88,项目名称:webtuthien,代码行数:88,代码来源:IndexController.php


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