久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

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

        使用 Zend Framework 和 PHP 發送電子郵件

        Sending email using Zend Framework and PHP(使用 Zend Framework 和 PHP 發送電子郵件)

      1. <legend id='8ADIi'><style id='8ADIi'><dir id='8ADIi'><q id='8ADIi'></q></dir></style></legend>
          <bdo id='8ADIi'></bdo><ul id='8ADIi'></ul>
            1. <i id='8ADIi'><tr id='8ADIi'><dt id='8ADIi'><q id='8ADIi'><span id='8ADIi'><b id='8ADIi'><form id='8ADIi'><ins id='8ADIi'></ins><ul id='8ADIi'></ul><sub id='8ADIi'></sub></form><legend id='8ADIi'></legend><bdo id='8ADIi'><pre id='8ADIi'><center id='8ADIi'></center></pre></bdo></b><th id='8ADIi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8ADIi'><tfoot id='8ADIi'></tfoot><dl id='8ADIi'><fieldset id='8ADIi'></fieldset></dl></div>
                <tbody id='8ADIi'></tbody>
            2. <small id='8ADIi'></small><noframes id='8ADIi'>

              <tfoot id='8ADIi'></tfoot>

                  本文介紹了使用 Zend Framework 和 PHP 發送電子郵件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在編寫一個表單,當用戶輸入他們的電子郵件帳戶并點擊發送時,一封電子郵件將發送到他們的電子郵件帳戶.

                  I working on a form whereby when the user enter in their email account and click on send, an email will be sent to their email account.

                  我已經解決了所有問題.只是它不會將電子郵件發送到我的帳戶.有人有想法么?有沒有我遺漏的配置之類的?

                  I have everything worked out. Just that it doesnt send the email to my account. Anyone have any ideas? Is there a configuration that I left out or something?

                  這是來自我的控制器的示例:

                  This is the sample from my controller:

                  public function retrieveemailAction(){
                  
                      $users = new Users();
                      $email = $_POST['email'];                
                      $view = Zend_Registry::get('view'); 
                  
                      if($users->checkEmail($_POST['email'])) {
                  
                          // The Subject
                          $subject = "Email Test";
                  
                          // The message
                          $message = "this is a test";            
                  
                          // Send email
                          // Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
                          // Use if command to display email message status
                          if(mail($email, $subject, $message, $headers)) {
                              $view->operation = 'true';
                          }            
                      } else {
                           $view->operation = 'false';
                      }
                  
                      $view->render('retrieve.tpl');
                  }
                  

                  推薦答案

                  我建議您使用 Zend_Mail 而不是 mail().它可以自動處理很多東西,而且效果很好.

                  I recommend you use Zend_Mail instead of mail(). It handles a lot of stuff automatically and just works great.

                  你有 SMTP 服務器嗎?嘗試在沒有您自己的 SMTP 服務器的情況下發送郵件可能會導致郵件無法發送.

                  Do you have a SMTP server? Trying to send mail without your own SMTP server could be causing the mail to not be sent.

                  這是我使用 Zend_Mail 和 Gmail 發送郵件的方式:

                  This is what I use for sending mails using Zend_Mail and Gmail:

                  Bootstrap.php中,我配置了一個默認的郵件傳輸:

                  In Bootstrap.php, I configure a default mail transport:

                  protected function _initMail()
                  {
                      try {
                          $config = array(
                              'auth' => 'login',
                              'username' => 'username@gmail.com',
                              'password' => 'password',
                              'ssl' => 'tls',
                              'port' => 587
                          );
                  
                          $mailTransport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
                          Zend_Mail::setDefaultTransport($mailTransport);
                      } catch (Zend_Exception $e){
                          //Do something with exception
                      }
                  }
                  

                  然后我使用以下代碼發送電子郵件:

                  Then to send an email I use the following code:

                  //Prepare email
                  $mail = new Zend_Mail();
                  $mail->addTo($email);
                  $mail->setSubject($subject);
                  $mail->setBody($message);
                  $mail->setFrom('username@gmail.com', 'User Name');
                  
                  //Send it!
                  $sent = true;
                  try {
                      $mail->send();
                  } catch (Exception $e){
                      $sent = false;
                  }
                  
                  //Do stuff (display error message, log it, redirect user, etc)
                  if($sent){
                      //Mail was sent successfully.
                  } else {
                      //Mail failed to send.
                  }
                  

                  這篇關于使用 Zend Framework 和 PHP 發送電子郵件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                  <small id='3h2PN'></small><noframes id='3h2PN'>

                  <i id='3h2PN'><tr id='3h2PN'><dt id='3h2PN'><q id='3h2PN'><span id='3h2PN'><b id='3h2PN'><form id='3h2PN'><ins id='3h2PN'></ins><ul id='3h2PN'></ul><sub id='3h2PN'></sub></form><legend id='3h2PN'></legend><bdo id='3h2PN'><pre id='3h2PN'><center id='3h2PN'></center></pre></bdo></b><th id='3h2PN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3h2PN'><tfoot id='3h2PN'></tfoot><dl id='3h2PN'><fieldset id='3h2PN'></fieldset></dl></div>
                  • <bdo id='3h2PN'></bdo><ul id='3h2PN'></ul>

                    <legend id='3h2PN'><style id='3h2PN'><dir id='3h2PN'><q id='3h2PN'></q></dir></style></legend>

                        <tfoot id='3h2PN'></tfoot>

                            <tbody id='3h2PN'></tbody>
                            主站蜘蛛池模板: 在线午夜| 狠狠干天天干 | 99re视频在线观看 | 亚洲一区在线日韩在线深爱 | 国产一区二区三区免费 | 国产精品一区二区三区久久 | 色888www视频在线观看 | 玖玖视频国产 | 男女羞羞视频在线看 | 久久久亚洲一区 | 久久综合久久久 | 成人污污视频 | 久久精品国产一区二区三区 | 欧美午夜一区二区三区免费大片 | 国产视频二区 | 国产精品日韩欧美一区二区 | 99re99 | 激情一区二区三区 | 在线色网址 | 亚洲精品区 | 四虎影院免费在线播放 | 亚州精品天堂中文字幕 | 欧美成人激情 | 日韩二区 | 国产羞羞视频在线观看 | 欧美一区二区三 | 久久精品网 | 91视频一区二区 | av超碰| www日本在线播放 | 99免费视频 | 天堂在线免费视频 | 特一级黄色毛片 | 亚洲国产欧美在线 | 日批免费在线观看 | 日韩精品一区二区三区老鸭窝 | 亚洲视频中文字幕 | 亚洲国产精品99久久久久久久久 | www久久国产 | 欧美精品一区二区三区蜜桃视频 | 成年人在线视频 |