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

      <tfoot id='UCyts'></tfoot>

      <i id='UCyts'><tr id='UCyts'><dt id='UCyts'><q id='UCyts'><span id='UCyts'><b id='UCyts'><form id='UCyts'><ins id='UCyts'></ins><ul id='UCyts'></ul><sub id='UCyts'></sub></form><legend id='UCyts'></legend><bdo id='UCyts'><pre id='UCyts'><center id='UCyts'></center></pre></bdo></b><th id='UCyts'></th></span></q></dt></tr></i><div id='UCyts'><tfoot id='UCyts'></tfoot><dl id='UCyts'><fieldset id='UCyts'></fieldset></dl></div>
        • <bdo id='UCyts'></bdo><ul id='UCyts'></ul>
        <legend id='UCyts'><style id='UCyts'><dir id='UCyts'><q id='UCyts'></q></dir></style></legend>
      1. 服务器响应是: 5.7.0 必须首先发出 STARTTLS 命令.i16sm1806350pag.18 - gsmtp

        时间:2023-10-06
          • <bdo id='GemRr'></bdo><ul id='GemRr'></ul>
            <tfoot id='GemRr'></tfoot>

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

              <legend id='GemRr'><style id='GemRr'><dir id='GemRr'><q id='GemRr'></q></dir></style></legend>

                  <i id='GemRr'><tr id='GemRr'><dt id='GemRr'><q id='GemRr'><span id='GemRr'><b id='GemRr'><form id='GemRr'><ins id='GemRr'></ins><ul id='GemRr'></ul><sub id='GemRr'></sub></form><legend id='GemRr'></legend><bdo id='GemRr'><pre id='GemRr'><center id='GemRr'></center></pre></bdo></b><th id='GemRr'></th></span></q></dt></tr></i><div id='GemRr'><tfoot id='GemRr'></tfoot><dl id='GemRr'><fieldset id='GemRr'></fieldset></dl></div>
                    <tbody id='GemRr'></tbody>
                  本文介绍了服务器响应是: 5.7.0 必须首先发出 STARTTLS 命令.i16sm1806350pag.18 - gsmtp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 gmail 发送邮件,但遇到异常 SMTP 服务器需要安全连接或客户端未通过身份验证.服务器响应是: 5.7.0 必须首先发出 STARTTLS 命令.i16sm1806350pag.18 - gsmtp

                  I am trying to send mail using gmail, and I am getting an exception that is The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. i16sm1806350pag.18 - gsmtp

                  我为发送邮件编写的代码是:

                  code I have written for sending mail is:

                  MailMessage mail = new MailMessage(); 
                  mail.To.Add(txtEmail.Text.Trim()); 
                  mail.To.Add("Secondry@gmail.com");
                  mail.From = new MailAddress("mysendingmail@gmail.com");
                  mail.Subject = "Confirmation of Registration on Job Junction.";
                  string Body = "Hi, this mail is to test sending mail using Gmail in ASP.NET";
                  mail.Body = Body;
                  mail.IsBodyHtml = true;
                  SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
                  // smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
                  smtp.Credentials = new System.Net.NetworkCredential("mysendingmail@gmail.com", "password");
                  // smtp.Port = 587;
                  //Or your Smtp Email ID and Password
                  smtp.UseDefaultCredentials = false;
                  // smtp.EnableSsl = true;
                  smtp.Send(mail);
                  

                  请告诉我解决方案,我没有针对此异常的任何解决方案.

                  Please tell me solutions, I am not getting any solutions for this exception.

                  推荐答案

                  步骤(1): smtp.EnableSsl = true;

                  如果还不够:

                  步骤 (2): 必须使用 为 NetworkCredential 使用的 Gmail 帐户启用访问不太安全的应用程序"href="https://www.google.com/settings/u/1/security/lesssecureapps" rel="noreferrer">google 的设置页面:

                  Step (2): "Access for less secure apps" must be enabled for the Gmail account used by the NetworkCredential using google's settings page:

                  这篇关于服务器响应是: 5.7.0 必须首先发出 STARTTLS 命令.i16sm1806350pag.18 - gsmtp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:通过 GoDaddy 上的 gmail SMTP 发送电子邮件 下一篇:如何在 ASP.NET 表单中使用 gmail SMTP

                  相关文章

                  • <bdo id='VaOUK'></bdo><ul id='VaOUK'></ul>

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

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