• <small id='58RUl'></small><noframes id='58RUl'>

    <tfoot id='58RUl'></tfoot>

  • <legend id='58RUl'><style id='58RUl'><dir id='58RUl'><q id='58RUl'></q></dir></style></legend>

        <bdo id='58RUl'></bdo><ul id='58RUl'></ul>

        <i id='58RUl'><tr id='58RUl'><dt id='58RUl'><q id='58RUl'><span id='58RUl'><b id='58RUl'><form id='58RUl'><ins id='58RUl'></ins><ul id='58RUl'></ul><sub id='58RUl'></sub></form><legend id='58RUl'></legend><bdo id='58RUl'><pre id='58RUl'><center id='58RUl'></center></pre></bdo></b><th id='58RUl'></th></span></q></dt></tr></i><div id='58RUl'><tfoot id='58RUl'></tfoot><dl id='58RUl'><fieldset id='58RUl'></fieldset></dl></div>
      1. 如何在 Bluehost 上使用 phpMailer isSMTP?

        How to use phpMailer isSMTP on Bluehost?(如何在 Bluehost 上使用 phpMailer isSMTP?)

            <tbody id='PPvRc'></tbody>
              • <bdo id='PPvRc'></bdo><ul id='PPvRc'></ul>

                <small id='PPvRc'></small><noframes id='PPvRc'>

                <i id='PPvRc'><tr id='PPvRc'><dt id='PPvRc'><q id='PPvRc'><span id='PPvRc'><b id='PPvRc'><form id='PPvRc'><ins id='PPvRc'></ins><ul id='PPvRc'></ul><sub id='PPvRc'></sub></form><legend id='PPvRc'></legend><bdo id='PPvRc'><pre id='PPvRc'><center id='PPvRc'></center></pre></bdo></b><th id='PPvRc'></th></span></q></dt></tr></i><div id='PPvRc'><tfoot id='PPvRc'></tfoot><dl id='PPvRc'><fieldset id='PPvRc'></fieldset></dl></div>

              • <legend id='PPvRc'><style id='PPvRc'><dir id='PPvRc'><q id='PPvRc'></q></dir></style></legend>

                  <tfoot id='PPvRc'></tfoot>
                  本文介绍了如何在 Bluehost 上使用 phpMailer isSMTP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我花了好几天才得到正确的设置,所以我想我会发布一个适用于 Bluehost 的 php 脚本.在初始测试中,使用 isSMTP 比 isMAIL 更快.

                  It's taken me days to get the right settings so I thought I would post a php script that works on Bluehost. In initial tests using isSMTP is faster than isMAIL.

                  <?php
                  require_once '../includes/phpmailer/PHPMailerAutoload.php';
                  
                  $mail = new PHPMailer();
                  
                  $mail->IsSMTP();                         // set mailer to use SMTP
                  $mail->Host = "box1311.bluehost.com";    // specify bluehost as outgoing server
                  $mail->SMTPSecure = "tls";               // sets the prefix to the server do not use ssl
                  $mail->SMTPDebug  = 3;                   // comment out if you don't need debug info
                  $mail->SMTPAuth   = true;                // turn on SMTP authentication
                  $mail->Username   = "USER@EXAMPLE.COM";  // SMTP username (your email account)
                  $mail->Password   = "PASSWORD";          // SMTP password
                  $mail->Port       = 25;
                  $mail->From       = 'USER@EXAMPLE.COM';
                  $mail->FromName   = "USER@EXAMPLE.COM";
                  $mail->AddAddress('CLIENT@gmail.com');
                  $mail->IsHTML(true);                     // set email format to HTML
                  
                  $mail->Subject = 'test message';
                  $body = '<!DOCTYPE html>
                             <html><header>
                                   </header>
                                   <body lang=EN-US>
                                      <div style="text-align:center">
                                        <h2>this is a test</h2>
                                      </div>
                                   </body>
                              </html>';
                  $mail->Body    = $body;
                  
                  $mail->AltBody = "This is the body in plain text for non-HTML mail clients";
                  
                  if(!$mail->Send()){
                     echo "Message could not be sent. <p>";
                     echo "Mailer Error: " . $mail->ErrorInfo;
                  }else{
                    echo '<h1>message sent</h1>';
                  }
                  ?>
                  

                  推荐答案

                  这段代码对我有用.

                  include "phpmailer/class.phpmailer.php";
                  include "phpmailer/class.smtp.php";
                  
                  $email_user = "email@host.com";
                  $email_password = "pass123";
                  $the_subject = "Title";
                  $from_name = "Sender";
                  $phpmailer = new PHPMailer();
                  
                  // ---------- datos de la cuenta de correo -----------------------------
                  $phpmailer->Username = $email_user;
                  $phpmailer->Password = $email_password; 
                  //---------------------------------------------------------------------
                  $phpmailer->SMTPSecure = 'tls';
                  $phpmailer->Host = "box6171.bluehost.com";
                  $phpmailer->Port = 26;
                  //$phpmailer->SMTPDebug = 2;
                  $phpmailer->IsSMTP();
                  $phpmailer->SMTPAuth = true;
                  
                  $phpmailer->setFrom($phpmailer->Username,$from_name);
                  $phpmailer->AddAddress("to@host.com");
                  $phpmailer->Subject = $the_subject; 
                  
                  $phpmailer->Body .="<h1 style='color:#3498db;'>Attachment:</h1>";
                  $phpmailer->Body .= "<h3>".$attach1."</h3>";
                  
                  $phpmailer->AddAttachment($attach, "attach1");
                  $phpmailer->AddBCC("hidecopy@host.com", "bcc1");
                  $phpmailer->IsHTML(true);
                  $enviado = $phpmailer->Send();
                  if($enviado) {
                      echo 'email send successful';
                  }
                  

                  这篇关于如何在 Bluehost 上使用 phpMailer isSMTP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  smtp gmail server php mailer not working(smtp gmail服务器php邮件程序不工作)
                  Email goes in spam when I send it via others SMTP server(当我通过其他 SMTP 服务器发送电子邮件时,电子邮件进入垃圾邮件)
                1. <i id='QCAt3'><tr id='QCAt3'><dt id='QCAt3'><q id='QCAt3'><span id='QCAt3'><b id='QCAt3'><form id='QCAt3'><ins id='QCAt3'></ins><ul id='QCAt3'></ul><sub id='QCAt3'></sub></form><legend id='QCAt3'></legend><bdo id='QCAt3'><pre id='QCAt3'><center id='QCAt3'></center></pre></bdo></b><th id='QCAt3'></th></span></q></dt></tr></i><div id='QCAt3'><tfoot id='QCAt3'></tfoot><dl id='QCAt3'><fieldset id='QCAt3'></fieldset></dl></div>
                    <tbody id='QCAt3'></tbody>
                  1. <legend id='QCAt3'><style id='QCAt3'><dir id='QCAt3'><q id='QCAt3'></q></dir></style></legend>

                    <small id='QCAt3'></small><noframes id='QCAt3'>

                    <tfoot id='QCAt3'></tfoot>

                          <bdo id='QCAt3'></bdo><ul id='QCAt3'></ul>