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


PHP phpmailer::ClearCustomHeaders方法代码示例

本文整理汇总了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;
}
开发者ID:alencarmo,项目名称:OCF,代码行数:57,代码来源:envmail.php

示例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'], "");
开发者ID:alencarmo,项目名称:OCF,代码行数:31,代码来源:prc_backup.php


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