<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # ASP.NET Web Pages - WebMail 幫助器 WebMail 幫助器 - 眾多有用的 ASP.NET Web 幫助器之一。 ## WebMail 幫助器 WebMail 幫助器讓發送郵件變得更簡單,它按照 SMTP(Simple Mail Transfer Protocol 簡單郵件傳輸協議)從 Web 應用程序發送郵件。 ## 前提:電子郵件支持 為了演示如何使用電子郵件,我們將創建一個輸入頁面,讓用戶提交一個頁面到另一個頁面,并發送一封關于支持問題的郵件。 ## 第一:編輯您的 AppStart 頁面 如果在本教程中您已經創建了 Demo 應用程序,那么您已經有一個名為 _AppStart.cshtml 的頁面,內容如下: ## _AppStart.cshtml ``` @{ WebSecurity.InitializeDatabaseConnection("Users", "UserProfile", "UserId", "Email", true); } ``` 要啟動 WebMail 幫助器,向您的 AppStart 頁面中增加如下所示的 WebMail 屬性: ## _AppStart.cshtml ``` @{ WebSecurity.InitializeDatabaseConnection("Users", "UserProfile", "UserId", "Email", true); WebMail.SmtpServer = "smtp.example.com"; WebMail.SmtpPort = 25; WebMail.EnableSsl = false; WebMail.UserName = "support@example.com"; WebMail.Password = "password-goes-here"; WebMail.From = "john@example.com"; } ``` 屬性解釋: **SmtpServer:** 用于發送電子郵件的 SMTP 服務器的名稱。 **SmtpPort:** 服務器用來發送 SMTP 事務(電子郵件)的端口。 **EnableSsl:** 如果服務器使用 SSL(Secure Socket Layer 安全套接層)加密,則值為 true。 **UserName:** 用于發送電子郵件的 SMTP 電子郵件賬戶的名稱。 **Password:** SMTP 電子郵件賬戶的密碼。 **From:** 在發件地址欄顯示的電子郵件(通常與 UserName 相同)。 ## 第二:創建一個電子郵件輸入頁面 接著創建一個輸入頁面,并將它命名為 Email_Input: ## Email_Input.cshtml ``` <!DOCTYPE html> <html> <body> <h1>Request for Assistance</h1> <form method="post" action="EmailSend.cshtml"> <label>Username:</label> <input type="text name="customerEmail" /> <label>Details about the problem:</label> <textarea name="customerRequest" cols="45" rows="4"></textarea> <p><input type="submit" value="Submit" /></p> </form> </body> </html> ``` 輸入頁面的目的是手機信息,然后提交數據到可以將信息作為電子郵件發送的一個新的頁面。 ## 第三:創建一個電子郵件發送頁面 接著創建一個用來發送電子郵件的頁面,并將它命名為 Email_Send: ## Email_Send.cshtml ``` @{ // Read input var customerEmail = Request["customerEmail"]; var customerRequest = Request["customerRequest"]; try { // Send email WebMail.Send(to:"someone@example.com", subject: "Help request from - " + customerEmail, body: customerRequest ); } catch (Exception ex ) { <text>@ex</text> } } ``` 想了解更多關于 ASP.NET Web Pages 應用程序發送電子郵件的信息,請查閱:[WebMail 對象參考手冊](webpages-ref-webmail.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>

                              哎呀哎呀视频在线观看