<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                >[info]類庫地址:https://github.com/PHPMailer/PHPMailer ## :-: **使用第3方類庫的常見思路** 1、各種引入(use也是引入) 2、new一個實例 3、通過new出來的對象,調用各種屬性賦值和方法完成功能 >[warning]注意:我只是給官方demo拉過來跑了一遍,給注釋改成中文了,代碼中另附了3個小案例 ~~~ php <?php /** * 發送郵件 * 使用第3方類庫的常見思路 * 1、各種引入(use也是引入) * 2、new一個實例 * 3、通過new出來的對象,調用各種屬性賦值和方法完成功能 */ //1、各種引入(use也是引入) use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; $rootPath = dirname(__FILE__); require $rootPath.'/vendor/autoload.php'; $mail = new PHPMailer(true); //2、實體化類 //3、通過new出來的對象,調用各種屬性賦值,方法完成功能 try { //配置 $mail->SMTPDebug = 2; // 調試模式和telnet發郵件一模一樣 $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.qq.com'; //使用騰訊的 163有毒老是什么反垃圾 $mail->SMTPAuth = true; //啟用SMTP身份驗證 $mail->CharSet = 'UTF-8'; //設置郵件編碼 $mail->Username = '692391332@qq.com'; //SMTP username $mail->Password = 'bhrrcasxxxxxxxxx'; // SMTP password //$mail->SMTPSecure = 'tls'; //啟用TLS加密,“ssl”也接受 //$mail->Port = 587; //連接到的tcp端口 $mail->setFrom('692391332@qq.com', 'Mailer'); //發件人 $mail->addAddress('134xxxxxxxx@163.com', 'Joe User'); //收件人,//第2個參數可選,發給多個人直接寫foreach里 $mail->addReplyTo('692391332@qq.com', 'Information'); //假設收件人回復,發給誰 //$mail->addCC('cc@example.com'); //抄送 //$mail->addBCC('bcc@example.com'); //密送 $mail->isHTML(true); //$mail->Body帶html標簽,就true $mail->Subject = 'Here is the subject'; //主題 //$mail->AltBody = '不帶html標簽的'; //不知道這干嘛用 //發送實例:1、官網demo發送的內容帶html標簽。注意:需要給isHTML打開設為true //$mail->Body = '帶html<b>標簽的</b>'; //發送實例:2、發送附件 //$mail->addAttachment('img/1.png'); //發送帶圖片的 //$mail->Body = '單獨發送附件不可以,要帶內容'; //發送實例:3、使用郵件模板發送內容。注意:要先讀取文件和不要使用$mail->Body $mail->msgHTML(file_get_contents('img/emiltpl.html')); $mail->send(); //發送 echo 'Message has been sent'; } catch (Exception $e) { echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; } ~~~ **emiltpl.html發郵件用的 郵件模板demo** ~~~ html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> #div{width:100px;height:100px;background:red;} /*內連樣式寫法*/ </style> </head> <body> <div id="div"> test </div> </body> </html> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看