本文整理汇总了PHP中phpmailer::ClearCustomHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP phpmailer::ClearCustomHeaders方法的具体用法?PHP phpmailer::ClearCustomHeaders怎么用?PHP phpmailer::ClearCustomHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpmailer
的用法示例。
在下文中一共展示了phpmailer::ClearCustomHeaders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: envmail
function envmail($email, $subject, $msg, $from, $fromname = "Opala Clube Franca")
{
require_once "class.phpmailer.php";
$mail = new phpmailer();
$mail->ClearAddresses();
$mail->ClearAllRecipients();
$mail->ClearAddresses();
$mail->ClearCustomHeaders();
$mail->IsSMTP();
// $mail->IsSendmail();
$mail->From = $from;
$mail->FromName = $fromname;
// $mail->Hostname = "smtp.gmail.com";
// $mail->Host = "smtp.gmail.com";
$mail->SMTPSecure = "ssl";
$mail->Hostname = "smtp.opalaclubefranca.com.br";
$mail->Host = "smtp.opalaclubefranca.com.br";
// $mail->SMTPDebug = 2;
$mail->Username = "admin@opalaclubefranca.com.br";
$mail->Password = "racnela";
$mail->SMTPAuth = true;
$mail->Port = 465;
$mail->Timeout = 120;
$body = $msg;
$text_body = $msg;
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AltBody = $text_body;
if (is_array($email)) {
foreach ($email as $em) {
$mail->AddAddress($em, "");
}
} else {
$mail->AddAddress($email, "");
}
/* echo '<tr><td>To '.$email.'</td></tr>'."\n";
echo '<tr><td>Assunto '.$subject.'</td></tr>'."\n";
echo '<tr><td>Mensagem '.$msg.'</td></tr>'."\n";
echo '<tr><td>From '.$from.'</td></tr>'."\n";
*/
$exito = $mail->Send();
$v = 0;
// echo "<tr><td>ErrorInfo " . $mail->ErrorInfo . "<br></td></tr>";
while (!$exito && $v < 5 && $mail->ErrorInfo != "SMTP Error: Data not accepted.") {
sleep(2);
$exito = $mail->Send();
echo "<tr><td>ErrorInfo " . $mail->ErrorInfo . "<br></td></tr>";
$v = $v + 1;
}
if (!$exito) {
echo "<tr><td>There has been a mail error sending to " . $mail->ErrorInfo . "<br></td></tr>";
}
$mail->ClearAddresses();
$mail->ClearAttachments();
return $mail->ErrorInfo;
}
示例2: sprintf
<?php
session_cache_limiter('nocache');
session_start();
require "class.phpmailer.php";
require_once "prc_execsql.php";
$consulta = sprintf("select emailwbm from cad_param");
$result = execsql($consulta);
$row = mysql_fetch_assoc($result);
$mail = new phpmailer();
$mail->ClearAddresses();
$mail->ClearAllRecipients();
$mail->ClearAddresses();
$mail->ClearCustomHeaders();
$mail->IsSMTP();
$mail->From = "bolaodoalex@yahoo.com.br";
$mail->FromName = "Backup Bolão";
$mail->Hostname = "smtp.netsite.com.br";
$mail->Host = "smtp.netsite.com.br";
// $mail->SMTPDebug = 2;
$mail->Username = "alencarmo";
$mail->Password = "12345678";
$mail->SMTPAuth = true;
$mail->Timeout = 120;
$body = "Backup automático do bolão";
$text_body = "Backup automático do bolão";
$mail->isHTML(true);
$mail->Subject = sprintf("Backup Bolão do dia %s", date("d/m/Y H:i:s"));
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($row['emailwbm'], "");