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


PHP phpmailer::isHTML方法代码示例

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


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

示例1: send_mail

function send_mail($email, $date, $time)
{
    require '../phpmailer/PHPMailerAutoload.php';
    $mail = new phpmailer();
    $mail->isSMTP();
    $mail->Host = 'smtp.gmail.com';
    $mail->SMTPAuth = true;
    $mail->Username = 'sulemartin87@gmail.com';
    $mail->Password = 'Kisamymum96';
    $mail->SMTPSecure = 'tls';
    $mail->Port = 587;
    $mail->setFrom('sulemartin87@gmail.com', 'Mailer');
    $mail->addAddress('' . $email . '', 'user');
    $mail->isHTML(true);
    $mail->Subject = 'booking';
    $mail->Body = 'This email is coming from global styling to: ' . $email . ' </br>
								your booking is set for ' . $date . ' at ' . $time . ' 
								thank you for booking with us. Global Styling';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
    if (!$mail->send()) {
        echo 'Message could not be sent.';
        echo 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        echo 'Message has been sent to your E-Mail address';
    }
}
开发者ID:sulemartin87,项目名称:assignment,代码行数:26,代码来源:success_booking.php

示例2: 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

示例3: emailSend

 function emailSend($data)
 {
     $stime = array_sum(explode(' ', microtime()));
     require_once "getmxrr.php";
     $smtp =& $this->params;
     $mail = new phpmailer();
     $mail->Mailer = "smtp";
     $mail->From = isset($data['from']) & !empty($data['from']) ? $data['from'] : 'info@rusoft.ru';
     $mail->FromName = isset($data['fromName']) & !empty($data['fromName']) ? $data['fromName'] : 'RuSoft';
     $mail->Sender = isset($data['from']) & !empty($data['from']) ? $data['from'] : 'info@rusoft.ru';
     $mail->Host = $smtp['host'];
     $mail->CharSet = $smtp['charset'];
     $mail->Encoding = $smtp['encoding'];
     $mail->Port = $smtp['port'];
     $mail->SMTPAuth = $smtp['auth'];
     $mail->Subject = isset($data['subj']) & !empty($data['subj']) ? $data['subj'] : '';
     if ($smtp['auth']) {
         $mail->Username = $smtp['user'];
         $mail->Password = $smtp['pass'];
     }
     // HTML body
     if (isset($data['mess']['html']) & !empty($data['mess']['html'])) {
         $body = $data['mess']['html'];
         $mail->isHTML(true);
     }
     // Plain text body (for mail clients that cannot read HTML)
     if (isset($data['mess']['text']) & !empty($data['mess']['text'])) {
         $text_body = $data['mess']['text'];
         $mail->isHTML(false);
     }
     $mail->AltBody = isset($text_body) ? $text_body : '';
     $mail->Body = isset($body) ? $body : (isset($text_body) ? $text_body : '');
     $i = 1;
     // порядковый номер файла
     //добавляем файлы прикрепленные файлы
     if (isset($data['attachment']) & !empty($data['attachment'])) {
         foreach ($data['attachment'] as $k => $item) {
             if (isset($item['binary']) & !empty($item['binary'])) {
                 $mail->AddStringAttachment($item["binary"], isset($item["name"]) & !empty($item["name"]) ? $item["name"] : 'file' . $i, $smtp['encoding']);
                 $i++;
             } elseif (isset($item['path']) & !empty($item['path'])) {
                 $mail->AddAttachment($item["path"], isset($item["name"]) & !empty($item["name"]) ? $item["name"] : 'file' . $i, $smtp['encoding']);
                 $i++;
             }
         }
     }
     // добавляем файлы, отображаемые на странице
     if (isset($data['embedded']) & !empty($data['embedded'])) {
         foreach ($data['embedded'] as $k => $item) {
             if (isset($item['path']) & !empty($item['path'])) {
                 $mail->AddEmbeddedImage($item["path"], isset($item["cid"]) & !empty($item["cid"]) ? $item["cid"] : $i, isset($item["name"]) & !empty($item["name"]) ? $item["name"] : 'file' . $i, $smtp['encoding']);
                 $i++;
             }
         }
     }
     //pr($mail);
     //на данном этапе имеется уже собранное письмо и нам необходимо определить mx серверы для отправки...для каждого письма.
     //чтобы повторно не искать серверы в момент отправки для каждого...
     //сохраняем для каждого домена один и тот же сервер
     $mxsrvs = array();
     $mxemails = array();
     $debug['ctime'] = round((array_sum(explode(' ', microtime())) - $stime) * 1000, 2) . " ms";
     foreach ($data['to'] as $email => $name) {
         //берем чисто host
         if (!$this->_is_valid_email($email)) {
             $debug['emails'][$email]['error'] = "неправильно указан email адрес.";
             continue;
         }
         $host = substr($email, strpos($email, "@") + 1);
         $domains = explode(".", $host);
         foreach ($domains as $level => $domain) {
             $address = implode(".", $domains);
             if (!key_exists($address, $mxsrvs)) {
                 $time = array_sum(explode(' ', microtime()));
                 if (getmxrr_portable($address, $mxhosts, $preference) == true) {
                     array_multisort($preference, $mxhosts);
                 }
                 $debug['emails'][$email]['mxtime'] = round((array_sum(explode(' ', microtime())) - $time) * 1000, 2) . " ms";
                 if (!empty($mxhosts)) {
                     $mxhosts[] = $smtp['host'];
                     //потому что shadow тормознутый сервак
                     if (in_array('shadow.rusoft.ru', $mxhosts)) {
                         unset($mxhosts[0]);
                     }
                     //чтобы включить рассылку на smtp серверы получателей, необходимо закоментировать следующую строчку
                     $mxhosts = array_reverse($mxhosts);
                     $mxsrvs[$address] = $mxhosts;
                     $mxemails[$email] =& $mxsrvs[$address];
                     $debug['emails'][$email]['mxsrvs'] =& $mxsrvs[$address];
                     break;
                 } else {
                     unset($domains[$level]);
                 }
             } else {
                 $debug['emails'][$email]['mxtime'] = 'cache(0 ms)';
                 $mxemails[$email] =& $mxsrvs[$address];
                 $debug['emails'][$email]['mxsrvs'] =& $mxsrvs[$address];
             }
         }
     }
//.........这里部分代码省略.........
开发者ID:romlg,项目名称:cms36,代码行数:101,代码来源:sender.php

示例4: sprintf

$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'], "");
$mail->AddAttachment("/home/bkbolao/bkdados.tar.gz");
$mail->AddAttachment("/home/bkbolao/bkfontes.tar.gz");
$exito = $mail->Send();
$v = 0;
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) {
开发者ID:alencarmo,项目名称:OCF,代码行数:31,代码来源:prc_backup.php

示例5: header

    }
    if (!isset($error_message)) {
        $email_body = "";
        $email_body .= "Name: " . $name . "\n";
        $email_body .= "Email: " . $email . "\n";
        $email_body .= "Suggested Item\n";
        $email_body .= "Category: " . $category . "\n";
        $email_body .= "Title: " . $title . "\n";
        $email_body .= "Format: " . $format . "\n";
        $email_body .= "Genre: " . $genre . "\n";
        $email_body .= "Year: " . $year . "\n";
        $email_body .= "Details: " . $details . "\n";
        $mail->setFrom($email, $name);
        $mail->addAddress('info@daishodesign.com', 'Daisho');
        // Add a recipient
        $mail->isHTML(false);
        // Set email format to HTML
        $mail->Subject = 'Personal Media Library Suggestion from ' . $name;
        $mail->Body = $email_body;
        if ($mail->send()) {
            header("location:suggest.php?status=thanks");
            exit;
        }
        $error_message = 'Message could not be sent.';
        $error_message .= 'Mailer Error: ' . $mail->ErrorInfo;
    }
}
$pageTitle = "Suggest a Media Item";
$section = "suggest";
include "inc/header.php";
?>
开发者ID:kdaisho,项目名称:kdaisho.basic-php-website,代码行数:31,代码来源:suggest.php

示例6: phpmailer

 function send_mail()
 {
     require 'phpmailer/PHPMailerAutoload.php';
     $email = "";
     $mail = new phpmailer();
     $mail->isSMTP();
     $mail->Host = 'smtp.gmail.com';
     $mail->SMTPAuth = true;
     $mail->Username = 'sulemartin87@gmail.com';
     $mail->Password = 'Kisamymum96';
     $mail->SMTPSecure = 'tls';
     $mail->Port = 587;
     $mail->setFrom('sulemartin87@gmail.com', 'Mailer');
     $mail->addAddress('martinsuleman@rocketmail.com', 'user');
     $mail->isHTML(true);
     $mail->Subject = 'The code works';
     $mail->Body = 'This email is coming from <b> GLOBAL STYLING SALONS !! </b>';
     $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
     if (!$mail->send()) {
         echo 'Message could not be sent.';
         echo 'Mailer Error: ' . $mail->ErrorInfo;
     } else {
         echo 'Message has been sent to your E-Mail address';
     }
 }
开发者ID:sulemartin87,项目名称:assignment,代码行数:25,代码来源:index.php


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