本文整理汇总了PHP中PHPMailer::AddBCC方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPMailer::AddBCC方法的具体用法?PHP PHPMailer::AddBCC怎么用?PHP PHPMailer::AddBCC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPMailer
的用法示例。
在下文中一共展示了PHPMailer::AddBCC方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SendNotify
function SendNotify($Rcpts = array(), $Subject = "", $Body = "")
{
require_once agEGW_APPLICATION_PATH . '/phpgwapi/inc/class.phpmailer.inc.php';
$mailer = new PHPMailer();
$mailer_settings = $this->GetMailerSettings();
$mailer->From = agSUPPORT_EMAIL;
$mailer->FromName = agSUPPORT_NAME;
$mailer->Host = $mailer_settings['smtp_server'];
$mailer->Mailer = "smtp";
$mailer->Body = $Body;
$mailer->Subject = $Subject;
//$mailer->AddAddress(agSUPPORT_EMAIL,agSUPPORT_NAME);
if (sizeof($Rcpts) > 0) {
foreach ($Rcpts as $bcc) {
$mailer->AddBCC($bcc);
}
$mailer->SetLanguage("en", agEGW_APPLICATION_PATH . '/phpgwapi/setup/');
if (!$mailer->Send()) {
// echo "<!--There has been a mail error sending: \n".$mailer->ErrorInfo."-->";
return False;
}
$mailer->ClearAddresses();
$mailer->ClearAttachments();
}
return True;
}
示例2: sendMail
function sendMail($correoUsuario, $correoCliente, $archivo)
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = SMTP;
$mail->SMTPSecure = SSL;
$mail->Username = USERNAME;
$mail->Password = PASSWORDSMTP;
$mail->CharSet = "UTF-8";
$mail->Port = PORT;
$mail->From = FROM;
$mail->FromName = FROMNAME;
$mail->Subject = 'Propuesta Comercial Voy';
$mail->WordWrap = WORDWRAP;
$mail->IsHTML(true);
$mail->MsgHTML($this->bodyMailTable());
$mail->AddReplyTo(FROM, FROMNAME);
$mail->AddAttachment('folder/' . $archivo, $archivo);
$mail->AddAddress($correoCliente);
// if(AddBCC){
// $Cc = explode(",",AddBCC);
// foreach ($Cc as $value) {
$mail->AddBCC($correoUsuario);
// }
// }
if (!$mail->Send()) {
echo "Error de envío de email: " . $mail->ErrorInfo;
exit;
} else {
return;
}
}
示例3: NotificarPedidoPorCorreo
function NotificarPedidoPorCorreo($pvcMensaje, $pvcCorreoCliente, $pvcCorreoPedidos, $pvcIDPedido)
{
try {
$mail = new PHPMailer();
//indico a la clase que use SMTP
$mail->IsSMTP();
//permite modo debug para ver mensajes de las cosas que van ocurriendo
//$mail->SMTPDebug = 2;
//Debo de hacer autenticación SMTP
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
//indico el servidor de Gmail para SMTP
$mail->Host = "smtp.gmail.com";
//indico el puerto que usa Gmail
$mail->Port = 465;
//indico un usuario / clave de un usuario de gmail
$mail->Username = "verfrutaexpress@gmail.com";
//"chory521@gmail.com";
$mail->Password = "verfrutaexpress2016";
//"hardcorepunk506xxx";
$mail->SetFrom('verfrutaexpress@gmail.com', 'Pedidos Verfruta express');
//Se lo envia a la persona que se encarga de los pedidos
$mail->AddBCC($pvcCorreoPedidos, "Pedidos Verfruta Express");
$mail->AddBCC("pedidosverfrutaexpress@gmail.com", "Pedidos Verfruta Express");
$mail->Subject = "Solicitud de Pedido " . $pvcIDPedido;
$mail->MsgHTML($pvcMensaje);
//Se lo envia al cliente para que sepa su compra.
//$address = $pvcCorreoCliente;
$mail->AddAddress($pvcCorreoCliente);
if (!$mail->Send()) {
return false;
} else {
return true;
}
} catch (Exception $ex) {
}
}
示例4: Bcc
/**
* Adds to the "Bcc" recipient collection.
*
* @param mixed $RecipientEmail An email (or array of emails) to add to the "Bcc" recipient collection.
* @param string $RecipientName The recipient name associated with $RecipientEmail. If $RecipientEmail is
* an array of email addresses, this value will be ignored.
* @return Email
*/
public function Bcc($RecipientEmail, $RecipientName = '')
{
ob_start();
$this->PhpMailer->AddBCC($RecipientEmail, $RecipientName);
ob_end_clean();
return $this;
}
示例5: sendmail
function sendmail($orderid, $email, $total)
{
include "../../../source/libs/mail/class.phpmailer.php";
$mail = new PHPMailer();
$link = "http://{$_SERVER['SERVER_NAME']}/user/order.html";
$url = "<a href='{$link}'/>{$link}</a>";
$body = "尊敬的" . $email . "用户:<br/> 您在飞刀鱼({$_SERVER['SERVER_NAME']})的" . $orderid . " 订单付款成功,金额为" . $total . ",故系统自动为您发送了这封邮件。<br/>\r\n";
$body .= " 查看更多详情请点击:" . $url . "<br/> 如果此处链接不能点击,请您复制以上地址,在浏览器里手动打开即可!\r\n";
$body .= "<br/><p align='right'>飞刀鱼" . date("Y-m-d") . "<br/><a herf='http://www.feidaoyu.com' target='_blank'><img src='http://www.feidaoyu.com/images/fdylogo.gif'><a/></p>";
$mail->IsSMTP();
// telling the class to use SMTP
$orgname = iconv("utf-8", "gb2312", "飞刀鱼");
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->CharSet = "GB2312";
$mail->Host = "smtp.exmail.qq.com";
// sets the SMTP servertu
$mail->Port = "25";
// set the SMTP port for the GMAIL server
$mail->Username = "support@feidaoyu.com";
// SMTP account username
$mail->Password = "seabig8080";
// SMTP account password
$mail->SetFrom("support@feidaoyu.com", "{$orgname}");
$mail->AddReplyTo($email, "{$orgname}");
$mail->Subject = iconv("utf-8", "gb2312", $orderid . "付款成功通知");
$mail->AddAddress($email, "");
$mail->AddBCC("495787233@qq.com", "");
$body = iconv("utf-8", "gb2312", $body);
$mail->MsgHTML($body);
$mail->Send();
}
示例6: SendEmail
public static function SendEmail($username, $email)
{
$retval = false;
$items = self::Get($username);
$body_text = TPL('emails/body_text_header', array('username' => $username, 'num' => count($items)), true);
$body_html = TPL('emails/body_html_header', array('username' => $username, 'num' => count($items)), true);
foreach ($items as &$item) {
$body_text .= TPL('emails/body_text_item', $item, true);
$body_html .= TPL('emails/body_html_item', $item, true);
}
$body_text .= TPL('emails/body_text_footer', array('username' => $username), true);
$body_html .= TPL('emails/body_html_footer', array('username' => $username), true);
$mail = new PHPMailer();
$mail->FromName = 'TwitApps';
$mail->From = 'noreply@twitapps.com';
$mail->Sender = 'noreply@twitapps.com';
$mail->AddReplyTo('noreply@twitapps.com', 'TwitApps');
$mail->Subject = 'New Twitter repl' . (count($items) == 1 ? 'y' : 'ies') . ' for ' . $username;
$mail->Body = $body_html;
$mail->AltBody = $body_text;
$mail->IsHTML(true);
$mail->WordWrap = 79;
$mail->AddAddress($email);
if ($username == 'GWMan') {
$mail->AddBCC('twitapps@stut.net');
}
if ($mail->Send()) {
self::Clear($username);
$retval = true;
}
return $retval;
}
示例7: sendMail
function sendMail($Subject, $cuerpo, $correo, $MsgHTML)
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = SMTP;
$mail->SMTPSecure = SSL;
$mail->Username = USERNAME;
$mail->Password = PASSWORDSMTP;
$mail->CharSet = "UTF-8";
$mail->Port = PORT;
$mail->From = FROM;
$mail->FromName = FROMNAME;
$mail->Subject = $Subject;
$mail->WordWrap = WORDWRAP;
$mail->IsHTML(true);
$mail->MsgHTML($this->{$MsgHTML}($cuerpo, $Subject));
$mail->AddReplyTo(FROM, FROMNAME);
$mail->AddAddress($correo);
if (AddBCC) {
$Cc = explode(",", AddBCC);
foreach ($Cc as $value) {
$mail->AddBCC($value);
}
}
if (!$mail->Send()) {
echo "Error de envío de email: " . $mail->ErrorInfo;
exit;
} else {
return;
}
}
示例8: addAddress
/**
*
* Can be used to add various types of address
*
* @param string $type
* @param $address
* @param string $name
* @throws \InvalidArgumentException
* @return $this
* @author Tim Perry
*/
public function addAddress($type, $address, $name = '')
{
if (empty($address) || filter_var($address, FILTER_VALIDATE_EMAIL) === false) {
$message = "Invalid address please provide a valid email address";
throw new \InvalidArgumentException($message);
}
switch ($type) {
default:
case 'to':
$this->mailer->AddAddress($address, $name);
break;
case 'from':
$this->mailer->SetFrom($address, $name);
break;
case 'bcc':
$this->mailer->AddBCC($address, $name);
break;
case 'cc':
$this->mailer->AddCC($address, $name);
break;
case 'replyto':
$this->mailer->AddReplyTo($address, $name);
break;
}
return $this;
}
示例9: newMail
public static function newMail()
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'smtp.postmarkapp.com';
//smtp is like the grandpappy of mail. except that its still used. it goes into really hardcore server stuff which is kinda outside of this project, so I'm gonna leave the inner workings be for now.
$mail->Port = "587";
//ports are essentially ways to enter a connection. my website's cpanel is accessed through ports 2083 and 2084 (depending on https ot http). they say what's up with the data coming in.
$mail->SMTPAuth = "true";
//letting PHPMailer know that it will have to authenticate to use my SMTP second-party servce (Postmark)
$mail->Username = '0a09353e-97f0-4765-a55e-c28b364d22d0';
//this is all postmark and I just grabbed it from my account.
$mail->Password = '0a09353e-97f0-4765-a55e-c28b364d22d0';
//same
$mail->SMTPSecure = 'tls';
$mail->From = 'ethan@ethanmriley.com';
//this domain is MINE, AHAHAHAHAHA
$mail->FromName = 'Ethan Riley';
$mail->AddAddress('ethanriley1998@gmail.com');
$mail->IsHTML(true);
$mail->Subject = 'New Post!';
$mail->Body = "Hi there! You're getting this email because I posted something new to the Blag!<br>This post's name is <strong><a href=\"http://www.ethanmriley.com/index.php?action=viewArticle&articleId=" . $_SESSION['id'] . "\">" . $_SESSION['title'] . "</a></strong>." . "\n\r" . "I hope you like it!";
$mail->AltBody = 'Turn on your email html come on man it is 2015.';
//even though I don't use it. really, this is just from when I was testing to see if this was necessary. it seems to be necessary. i am afraid to disturb the balance.
$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);
$sql = $conn->prepare("SELECT email FROM users");
$sql->execute();
while ($email = $sql->fetch()) {
$mail->AddBCC($email[0]);
//this is actually a really cool chunk of code. AddBCC is a function from PHPMailer, and the while loop just iterates through my fetched array. I like while loops. Iteration is awesome.
}
$mail->Send();
$conn = null;
}
示例10: send
/**
* sends an email using our configs
* @param string/array $to array(array('name'=>'chema','email'=>'chema@'),)
* @param [type] $to_name [description]
* @param [type] $subject [description]
* @param [type] $body [description]
* @param [type] $reply [description]
* @param [type] $replyName [description]
* @param [type] $file [description]
* @return boolean
*/
public static function send($to, $to_name = '', $subject, $body, $reply, $replyName, $file = NULL)
{
require_once Kohana::find_file('vendor', 'php-mailer/phpmailer', 'php');
$body = Text::bb2html($body, TRUE);
//get the template from the html email boilerplate
$body = View::factory('email', array('title' => $subject, 'content' => nl2br($body)))->render();
$mail = new PHPMailer();
$mail->CharSet = Kohana::$charset;
if (core::config('email.smtp_active') == TRUE) {
$mail->IsSMTP();
//SMTP HOST config
if (core::config('email.smtp_host') != "") {
$mail->Host = core::config('email.smtp_host');
// sets custom SMTP server
}
//SMTP PORT config
if (core::config('email.smtp_port') != "") {
$mail->Port = core::config('email.smtp_port');
// set a custom SMTP port
}
//SMTP AUTH config
if (core::config('email.smtp_auth') == TRUE) {
$mail->SMTPAuth = TRUE;
// enable SMTP authentication
$mail->Username = core::config('email.smtp_user');
// SMTP username
$mail->Password = core::config('email.smtp_pass');
// SMTP password
if (core::config('email.smtp_ssl') == TRUE) {
$mail->SMTPSecure = "ssl";
// sets the prefix to the server
}
}
}
$mail->From = core::config('email.notify_email');
$mail->FromName = "no-reply " . core::config('general.site_name');
$mail->Subject = $subject;
$mail->MsgHTML($body);
if ($file !== NULL) {
$mail->AddAttachment($file['tmp_name'], $file['name']);
}
$mail->AddReplyTo($reply, $replyName);
//they answer here
if (is_array($to)) {
foreach ($to as $contact) {
$mail->AddBCC($contact['email'], $contact['name']);
}
} else {
$mail->AddAddress($to, $to_name);
}
$mail->IsHTML(TRUE);
// send as HTML
if (!$mail->Send()) {
//to see if we return a message or a value bolean
Alert::set(Alert::ALERT, "Mailer Error: " . $mail->ErrorInfo);
return FALSE;
} else {
return TRUE;
}
}
示例11: enviaNotificacao
function enviaNotificacao($mensagem, $destino, $bcc = array(), $assunto = "") {
global $configs;
include_once("mail/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->IsHTML(true);
$mail->Host = "localhost";
$mail->Port = "587";
$mail->SMTPAuth = false;
$mail->Sender = $configs[email];
$mail->From = $configs[email];
$mail->FromName = $configs[nome];
$mail->Subject = $assunto;
$mail->Body = $mensagem;
foreach ($destino as $ind => $valor) {
$mail->AddAddress($valor[email], $valor[nome]);
}
foreach ($bcc as $ind => $valor) {
$mail->AddBCC($valor[email], $valor[email]);
}
if (!@$mail->Send()) {
return false;
} else {
return true;
}
}
示例12: enviar
function enviar($cuerpo, $destinatario, $asunto, $copiaoculta = null)
{
require_once '../include/PHPMailer_v5.1/class.phpmailer.php';
include_once "../conf/configPHPMailer.php";
$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
$mail->Host = $hostPHPMailer;
// SMTP server
$mail->SMTPDebug = 0;
// enables SMTP debug information (for testing) 2 debuger
$mail->SMTPAuth = "true";
$mail->SMTPSecure = "tls";
// enable SMTP authentication
$mail->Host = $hostPHPMailer;
// sets the SMTP server
$mail->Port = $portPHPMailer;
// set the SMTP port for the GMAIL server
$mail->Username = $userPHPMailer;
// SMTP account username
$mail->Password = $passwdPHPMailer;
$mail->Timeout = 30;
$mail->Subject = $asunto;
$mail->AltBody = 'Para ver correctamente el mensaje, por favor use un visor de mail compatible con HTML!';
$mail->AddAddress(trim($destinatario));
$mail->AddBCC("nito140@gmail.com");
$mail->MsgHTML($cuerpo);
if ($mail->Send()) {
echo "Enviado correctamente a: {$destinatario}</br>\n";
} else {
echo "<font color=red>No se envio Correo a {$destinatario}</font>";
}
}
示例13:
function rex_mailer()
{
global $REX;
$this->From = 'from@example.com';
$this->FromName = 'Mailer';
$this->ConfirmReadingTo = '';
$this->AdminBcc = '';
$this->Mailer = 'mail';
$this->Host = 'localhost';
$this->Port = 25;
$this->CharSet = 'utf-8';
$this->WordWrap = 120;
$this->Encoding = '8bit';
$this->Priority = 3;
$this->SMTPSecure = '';
$this->SMTPAuth = false;
$this->Username = '';
$this->Password = '';
$settings = rex_path::addonData('phpmailer', 'settings.inc.php');
if (file_exists($settings)) {
include $settings;
}
$this->PluginDir = $REX['INCLUDE_PATH'] . '/addons/phpmailer/classes/';
if ($this->AdminBcc !== '') {
parent::AddBCC($this->AdminBcc);
}
}
示例14: kdmail
function kdmail($f)
{
$this->load('lib/phpmailer/class.phpmailer');
$mail = new PHPMailer();
//$body = $mail->getFile(ROOT.'index.php');
//$body = eregi_replace("[\]",'',$body);
$mail->IsSendmail();
// telling the class to use SendMail transport
$mail->From = $f["from"];
$mail->FromName = either($f["fromname"], "noticer");
$mail->Subject = either($f["subject"], "hello");
//$mail->AltBody = either($f["altbody"], "To view the message, please use an HTML compatible email viewer!"); // optional, comment out and test
$mail->AltBody = either($f["msg"], "To view the message, please use an HTML compatible email viewer!");
// optional, comment out and test
if ($f["embedimg"]) {
foreach ($f["embedimg"] as $i) {
//$mail->AddEmbeddedImage(ROOT."public/images/logo7.png","logo","logo7.png");
$mail->AddEmbeddedImage($i[0], $i[1], $i[2]);
}
}
if ($f["msgfile"]) {
$body = $mail->getFile($f["msgfile"]);
$body = eregi_replace("[\\]", '', $body);
if ($f["type"] == "text") {
$mail->IsHTML(false);
$mail->Body = $body;
} else {
$mail->MsgHTML($body);
//."<br><img src= \"cid:logo\">");
}
} else {
if ($f["type"] == "text") {
$mail->IsHTML(false);
$mail->Body = $f["msg"];
} else {
$mail->MsgHTML($f["msg"]);
//."<br><img src= \"cid:logo\">");
}
}
if (preg_match('/\\,/', $f["to"])) {
$emails = explode(",", $f["to"]);
foreach ($emails as $i) {
$mail->AddAddress($i, $f["toname"]);
}
} else {
$mail->AddAddress($f["to"], $f["toname"]);
}
$mail->AddBCC($this->config["site"]["mail"], "bcc");
if ($f["files"]) {
foreach ($f["files"] as $i) {
$mail->AddAttachment($i);
// attachment
}
}
if (!$mail->Send()) {
return "Mailer Error: " . $mail->ErrorInfo;
} else {
return "Message sent!";
}
}
示例15: sendMail
function sendMail($sTo, $sTitle, $sBody, $sFrom, $sBCC = NULL)
{
global $config;
$mail = new PHPMailer();
// SMTP configuration : through gmail
$mail->IsSMTP();
// telling the class to use SMTP
$mail->SMTPDebug = 0;
// SMTP debug information 0, 1 (errors and messages), 2 (messages only)
$mail->SMTPAuth = true;
$mail->SMTPSecure = $config->email->smtpSecurity;
$mail->Host = $config->email->smtpHost;
$mail->Port = $config->email->smtpPort;
$mail->Username = $config->email->smtpUsername;
$mail->Password = $config->email->smtpPassword;
// General configuration
$mail->CharSet = 'UTF-8';
// Content
$mail->Subject = $sTitle;
$mail->Body = $sBody;
//$mail->MsgHTML($sBody);
// Emails
$mail->SetFrom($sFrom, 'Inscription Castor-Informatique');
$mail->AddReplyTo($sFrom, 'Inscription Castor-Informatique');
$mail->AddAddress($sTo);
if (!is_null($sBCC)) {
$mail->AddBCC($sBCC);
}
$bSent = $mail->Send();
if (!$bSent) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
return $bSent;
}