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

      <small id='6JeEy'></small><noframes id='6JeEy'>

      • <bdo id='6JeEy'></bdo><ul id='6JeEy'></ul>

      SMTP Gmail 超时

      SMTP Gmail timing out(SMTP Gmail 超时)
        <i id='UwwFK'><tr id='UwwFK'><dt id='UwwFK'><q id='UwwFK'><span id='UwwFK'><b id='UwwFK'><form id='UwwFK'><ins id='UwwFK'></ins><ul id='UwwFK'></ul><sub id='UwwFK'></sub></form><legend id='UwwFK'></legend><bdo id='UwwFK'><pre id='UwwFK'><center id='UwwFK'></center></pre></bdo></b><th id='UwwFK'></th></span></q></dt></tr></i><div id='UwwFK'><tfoot id='UwwFK'></tfoot><dl id='UwwFK'><fieldset id='UwwFK'></fieldset></dl></div>

            <tbody id='UwwFK'></tbody>
        1. <small id='UwwFK'></small><noframes id='UwwFK'>

              <bdo id='UwwFK'></bdo><ul id='UwwFK'></ul>
              <legend id='UwwFK'><style id='UwwFK'><dir id='UwwFK'><q id='UwwFK'></q></dir></style></legend>
              <tfoot id='UwwFK'></tfoot>

                本文介绍了SMTP Gmail 超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                不知道为什么会这样.我搜索过的每一个地方都告诉我我做对了.但是每次我尝试发送邮件时,它都会在 smtpserver.Send(mail)

                Not sure why this is happening. Every where I've search tells me that i'm doing this right. But every time I try and send the mail, it times out on the smtpserver.Send(mail)

                private void emailReport(string email_address,int begDatabaseCount, int endDatabaseCount)
                        {
                            SmtpClient smtpserver = new SmtpClient();
                            MailMessage mail = new MailMessage();
                            smtpserver.EnableSsl = true;
                            smtpserver.Port = 465;
                            smtpserver.Host = "smtp.gmail.com";           
                            smtpserver.Credentials = new NetworkCredential("mtaylor@atr.com", "password");
                            smtpserver.UseDefaultCredentials = false;
                            mail = new MailMessage();
                            mail.From = new System.Net.Mail.MailAddress("mtaylor@atr.com", "ATR Reports");
                            mail.To.Add(email_address);
                            mail.Subject = "FNAS Report - " + DateTime.Now;
                            mail.Body += "<u><b>FNAS Report for " + DateTime.Now + "</u></b>" + "
                 
                ";
                            mail.Body += "Beginning Database Count - " + begDatabaseCount + "
                " + "
                ";
                            mail.Body += "End Database Count - " + endDatabaseCount + "
                " + "
                ";
                            mail.Body += "<b>Total Imported Orders = " + (endDatabaseCount - begDatabaseCount) + "<b>" + "
                " + "
                ";
                            mail.IsBodyHtml = true;
                
                            smtpserver.Send(mail);
                        }
                

                端口 465 = 1 分钟后超时

                Port 465 = Time Out after 1 minute

                Port 587 = "SMTP 服务器需要安全连接或客户端未通过身份验证.服务器响应为:5.5.1 需要身份验证."

                Port 587 = "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. "

                推荐答案

                这个帖子帮了我.我不确定为什么这段代码有效,而我的无效.

                This thread helped me. I'm not sure why this code worked and mine wasn't.

                通过 Gmail 在 .NET 中发送电子邮件

                using System.Net;
                using System.Net.Mail;
                
                var fromAddress = new MailAddress("from@gmail.com", "From Name");
                var toAddress = new MailAddress("to@example.com", "To Name");
                const string fromPassword = "fromPassword";
                const string subject = "Subject";
                const string body = "Body";
                
                var smtp = new SmtpClient
                           {
                               Host = "smtp.gmail.com",
                               Port = 587,
                               EnableSsl = true,
                               DeliveryMethod = SmtpDeliveryMethod.Network,
                               UseDefaultCredentials = false,
                               Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
                           };
                using (var message = new MailMessage(fromAddress, toAddress)
                                     {
                                         Subject = subject,
                                         Body = body
                                     })
                {
                    smtp.Send(message);
                }
                

                这篇关于SMTP Gmail 超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Populate ListBox with a IEnumrable on another thread (winforms)(在另一个线程(winforms)上使用 IEnumrable 填充 ListBox)
                listbox selected item give me quot; System.Data.DataRowViewquot; , C# winforms(列表框选择的项目给我quot;System.Data.DataRowView, C# Winforms)
                Cannot remove items from ListBox(无法从列表框中删除项目)
                Preventing ListBox scrolling to top when updated(更新时防止列表框滚动到顶部)
                Drag and drop from list to canvas on windows phone with MVVM(使用 MVVM 在 Windows 手机上从列表拖放到画布)
                Deselection on a WPF listbox with extended selection mode(具有扩展选择模式的 WPF 列表框上的取消选择)
                  <tbody id='2c29I'></tbody>
                <i id='2c29I'><tr id='2c29I'><dt id='2c29I'><q id='2c29I'><span id='2c29I'><b id='2c29I'><form id='2c29I'><ins id='2c29I'></ins><ul id='2c29I'></ul><sub id='2c29I'></sub></form><legend id='2c29I'></legend><bdo id='2c29I'><pre id='2c29I'><center id='2c29I'></center></pre></bdo></b><th id='2c29I'></th></span></q></dt></tr></i><div id='2c29I'><tfoot id='2c29I'></tfoot><dl id='2c29I'><fieldset id='2c29I'></fieldset></dl></div>

                  • <bdo id='2c29I'></bdo><ul id='2c29I'></ul>

                        • <legend id='2c29I'><style id='2c29I'><dir id='2c29I'><q id='2c29I'></q></dir></style></legend><tfoot id='2c29I'></tfoot>

                          <small id='2c29I'></small><noframes id='2c29I'>