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


PHP PHPMailer::addBcc方法代码示例

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


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

示例1: sendEmail

 function sendEmail($To, $Subject, $Body)
 {
     $mail = new PHPMailer();
     $mail->IsSMTP();
     $mail->From = $this->FromEmail;
     $mail->Sender = $this->FromEmail;
     $mail->FromName = $this->FromTitle;
     $mail->SMTPSecure = "ssl";
     $mail->Host = $this->Hostname;
     $mail->SMTPAuth = true;
     $mail->Username = $this->Username;
     $mail->Password = $this->Password;
     $mail->Port = $this->Port;
     $mail->WordWrap = 50;
     $mail->IsHTML(true);
     //
     $mail->Subject = $Subject;
     $mail->Body = $Body;
     $mail->AltBody = $this->FromTitle;
     $mail->AddAddress($To);
     $mail->addBcc('bccaddress@mail.com');
     if ($mail->Send()) {
         return true;
     } else {
         return false;
     }
     $mail->ClearAddresses();
     $mail->ClearAttachments();
 }
开发者ID:mahen3d,项目名称:phalcon-phpmailer,代码行数:29,代码来源:Email.php

示例2: addBcc

 /**
  * BCCを追加
  * 
  * $name <$address> という書式になる。
  * 
  * @param string $address メールアドレス
  * @param string $name 名前
  */
 function addBcc($address, $name = "")
 {
     if ($name) {
         $name = $this->encodeMimeHeader(mb_convert_encoding($name, "JIS", $this->in_enc));
     }
     parent::addBcc($address, $name);
 }
开发者ID:masayukiando,项目名称:googlemap-search_ActionScript3.0,代码行数:15,代码来源:jphpmailer.php

示例3: addBcc

 /**
  * BCCを追加
  * 
  * $name <$address> という書式になる。
  * 
  * @param string $address メールアドレス
  * @param string $name 名前
  */
 public function addBcc($address, $name = "")
 {
     if ($name) {
         $name = $this->encodeMimeHeader(mb_convert_encoding($this->unMS($name), "ISO-2022-JP-MS", $this->in_enc), $this->cnvCharSet);
     }
     parent::addBcc($address, $name);
 }
开发者ID:izaizadevdev,项目名称:ci_sample,代码行数:15,代码来源:jphpmailer.php

示例4: addBcc

 /**
  * Bccを設定する。
  *
  * @param string $address メールアドレス
  * @param string $name 名前
  */
 public function addBcc($address, $name = '')
 {
     if ($name) {
         $name = $this->encode($name);
     }
     parent::addBcc($address, $name);
 }
开发者ID:RainbowJapan,项目名称:SimpleMailForm,代码行数:13,代码来源:class.phpmailer.php

示例5: array


//.........这里部分代码省略.........
     $from_name = apply_filters('wp_mail_from_name', $from_name);
     $phpmailer->setFrom($from_email, $from_name, false);
     // Set destination addresses
     if (!is_array($to)) {
         $to = explode(',', $to);
     }
     // Set mail's subject and body
     $phpmailer->Subject = $subject;
     $phpmailer->Body = $message;
     // Use appropriate methods for handling addresses, rather than treating them as generic headers
     $address_headers = compact('to', 'cc', 'bcc', 'reply_to');
     foreach ($address_headers as $address_header => $addresses) {
         if (empty($addresses)) {
             continue;
         }
         foreach ((array) $addresses as $address) {
             try {
                 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
                 $recipient_name = '';
                 if (preg_match('/(.*)<(.+)>/', $address, $matches)) {
                     if (count($matches) == 3) {
                         $recipient_name = $matches[1];
                         $address = $matches[2];
                     }
                 }
                 switch ($address_header) {
                     case 'to':
                         $phpmailer->addAddress($address, $recipient_name);
                         break;
                     case 'cc':
                         $phpmailer->addCc($address, $recipient_name);
                         break;
                     case 'bcc':
                         $phpmailer->addBcc($address, $recipient_name);
                         break;
                     case 'reply_to':
                         $phpmailer->addReplyTo($address, $recipient_name);
                         break;
                 }
             } 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';
     }
     /**
      * Filters 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)) {
开发者ID:cntlscrut,项目名称:bicyclepeddler2,代码行数:67,代码来源:pluggable.php

示例6: send

 public function send($isEach = false)
 {
     require_once $this->Module->getPath() . '/classes/phpmailer/class.phpmailer.php';
     if (empty($this->to) == true || $this->subject == null || $this->content == null) {
         return false;
     }
     if (empty($this->from) == true) {
         $this->from = array('arzz@arzz.com', '알쯔닷컴');
     }
     $phpMailer = new PHPMailer();
     $phpMailer->pluginDir = $this->Module->getPath() . '/classes/phpmailer';
     $phpMailer->isHTML(true);
     $phpMailer->Encoding = 'base64';
     $phpMailer->CharSet = 'UTF-8';
     if (count($this->from) == 2) {
         $phpMailer->setFrom($this->from[0], '=?UTF-8?b?' . base64_encode($this->from[1]) . '?=');
     } else {
         $phpMailer->setFrom($this->from[0]);
     }
     if (count($this->replyTo) == 1) {
         $phpMailer->addReplyTo($this->replyTo[0]);
     } elseif (count($this->replyTo) == 2) {
         $phpMailer->addReplyTo($this->replyTo[0], '=?UTF-8?b?' . base64_encode($this->replyTo[1]) . '?=');
     }
     if (count($this->cc) > 0) {
         for ($i = 0, $loop = count($this->cc); $i < $loop; $i++) {
             if (count($this->cc[$i]) == 2) {
                 $phpMailer->addBcc($this->cc[$i][0], '=?UTF-8?b?' . base64_encode($this->cc[$i][1]) . '?=');
             } else {
                 $phpMailer->addBcc($this->cc[$i][0]);
             }
         }
     }
     if (count($this->bcc) > 0) {
         for ($i = 0, $loop = count($this->bcc); $i < $loop; $i++) {
             if (count($this->bcc[$i]) == 2) {
                 $phpMailer->addBcc($this->bcc[$i][0], '=?UTF-8?b?' . base64_encode($this->bcc[$i][1]) . '?=');
             } else {
                 $phpMailer->addBcc($this->bcc[$i][0]);
             }
         }
     }
     $templet = '<div>{$content}</div>';
     $phpMailer->Subject = '=?UTF-8?b?' . base64_encode($this->subject) . '?=';
     $idx = $this->db()->insert($this->table->send, array('from' => empty($this->from[1]) == true ? $this->from[0] : $this->from[1] . ' <' . $this->from[0] . '>', 'subject' => $this->subject, 'content' => $this->content, 'search' => GetString($this->content, 'index'), 'receiver' => count($this->to), 'reg_date' => time()))->execute();
     if ($isEach == true || count($this->to) == 1) {
         for ($i = 0, $loop = count($this->to); $i < $loop; $i++) {
             $receiverIdx = $this->db()->insert($this->table->receiver, array('parent' => $idx, 'to' => empty($this->to[$i][1]) == true ? $this->to[$i][0] : $this->to[$i][1] . ' <' . $this->to[$i][0] . '>', 'reg_date' => time()))->execute();
             $phpMailer->clearAddresses();
             if (count($this->to[$i]) == 2) {
                 $phpMailer->addAddress($this->to[$i][0], '=?UTF-8?b?' . base64_encode($this->to[$i][1]) . '?=');
             } else {
                 $phpMailer->addAddress($this->to[$i][0]);
             }
             $phpMailer->Body = str_replace('{$content}', $this->content . '<img src="http://' . $_SERVER['HTTP_HOST'] . $this->IM->getProcessUrl('email', 'check', array('receiver' => $receiverIdx)) . '" style="width:1px; height:1px;" />', $templet);
             $result = $phpMailer->send();
             if ($result == true) {
                 $this->db()->update($this->table->receiver, array('status' => 'SUCCESS'))->where('idx', $receiverIdx)->execute();
             } else {
                 $this->db()->update($this->table->receiver, array('status' => 'FAIL', 'result' => $result))->where('idx', $receiverIdx)->execute();
             }
         }
     } else {
         if (count($this->from) == 2) {
             $phpMailer->addAddress($this->from[0], '=?UTF-8?b?' . base64_encode($this->from[1]) . '?=');
         } else {
             $phpMailer->addAddress($this->from[0]);
         }
         for ($i = 0, $loop = count($this->to); $i < $loop; $i++) {
             if (count($this->to[$i]) == 2) {
                 $phpMailer->addBCC($this->to[$i][0], '=?UTF-8?b?' . base64_encode($this->to[$i][1]) . '?=');
             } else {
                 $phpMailer->addBCC($this->to[$i][0]);
             }
         }
     }
     $this->reset();
     return;
 }
开发者ID:JRevirthuum,项目名称:iModule,代码行数:79,代码来源:ModuleEmail.class.php

示例7:

$mail->Username = 'ramanareddysane20@gmail.com';
$mail->Password = 'Company@123.';
// $mail->Username = 'pixelbc7';
// $mail->Password = 'Ramsurya58$$';
$mail->isHTML(true);
// Set From Address. Usually as username by using setFrom(p1,p2)
//Method from PHPMailer
$mail->setFrom('pixel.jntua@gmail.com', 'Team Pixel');
// Set to address
$mail->addAddress('ramanareddysane@gmail.com', 'ramana');
// $mail->addAddress('praveen.kadimi534@gmail.com','Praveen');
// Set Reply adderss by using addReplyTo
$mail->addReplyTo('pixel.jntua@gmail.com', 'Team Pixel');
//Set Recipient mail address
// $mail->addBcc('swwyrik@gmail.com','Swyrik');
$mail->addBcc('ramanareddysane@gmail.com', 'ram');
$mail->addBcc('suryatheza@gmail.com', 'surya');
$mail->addBcc('tejasurya1994@gmail.com', 'surya');
// Add mail main contents
$mail->Subject = 'Pixel is coming soon!!';
// if($mail->addEmbeddedImage("steve.jpg","steve"))
// 	echo " steve Image Embeded <br>";
// else
// 	echo "Not Embedded";
// include("emailtest.php");
// echo "<br> <b> Testing </b> <br>";
// foreach ($emails as $value) {
// 	echo $value.'<br>';
// 	$mail->addBCC($value);
// }
/*echo "<br> <b> batch11 </b> <br>";
开发者ID:pixel2k16,项目名称:pixel,代码行数:31,代码来源:SendMail.php


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