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

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

      <legend id='a838u'><style id='a838u'><dir id='a838u'><q id='a838u'></q></dir></style></legend>
    1. <tfoot id='a838u'></tfoot>

      1. 雅虎邮箱的 C# SMTP 电子邮件发送代码失败,但适用于其他服务器,有人可以帮忙吗?

        C# SMTP email sending code fails for Yahoo Mail but works fine for other servers, can anyone help?(雅虎邮箱的 C# SMTP 电子邮件发送代码失败,但适用于其他服务器,有人可以帮忙吗?)
        <tfoot id='OhIWn'></tfoot>
          <tbody id='OhIWn'></tbody>
        • <bdo id='OhIWn'></bdo><ul id='OhIWn'></ul>
        • <legend id='OhIWn'><style id='OhIWn'><dir id='OhIWn'><q id='OhIWn'></q></dir></style></legend>

          1. <i id='OhIWn'><tr id='OhIWn'><dt id='OhIWn'><q id='OhIWn'><span id='OhIWn'><b id='OhIWn'><form id='OhIWn'><ins id='OhIWn'></ins><ul id='OhIWn'></ul><sub id='OhIWn'></sub></form><legend id='OhIWn'></legend><bdo id='OhIWn'><pre id='OhIWn'><center id='OhIWn'></center></pre></bdo></b><th id='OhIWn'></th></span></q></dt></tr></i><div id='OhIWn'><tfoot id='OhIWn'></tfoot><dl id='OhIWn'><fieldset id='OhIWn'></fieldset></dl></div>
          2. <small id='OhIWn'></small><noframes id='OhIWn'>

                  本文介绍了雅虎邮箱的 C# SMTP 电子邮件发送代码失败,但适用于其他服务器,有人可以帮忙吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用此代码通过 yahoo SMTP 服务器发送 SMTP 电子邮件,这是我正在编写的个人项目.

                  I am using this code to send an SMTP email via the yahoo SMTP server, it is for a personal project I am writing.

                  using System.Net.Mail;
                  using System.Net;
                  
                  SmtpClient theClient = new SmtpClient("smtp.mail.yahoo.com", 465);
                  theClient.UseDefaultCredentials = false;
                  theClient.Credentials = new NetworkCredential("username", "password");
                  theClient.EnableSsl = true;
                  
                  MailMessage theMessage = new MailMessage("username@yahoo.com", 
                                                           "to.someone@gmail.com");
                  
                  theMessage.Subject = "Dave test from C# subject";
                  theMessage.Body = "Dave test from C# body";
                  
                  theClient.Send(theMessage);
                  

                  这都是发送 SMTP 电子邮件的标准代码,但是……服务器似乎抛出了一个错误.它强行终止连接.如果我使用其他 SMTP 服务器(如 Gmail、Windows Live 或各种其他 ISP Smtp 服务器),则不会发生这种情况.

                  It's all pretty standard code for sending SMTP email, but... the server seems to throw an error. It forcibly terminates the connection. This does not happen if I use other SMTP servers like Gmail, Windows Live or various other ISP Smtp servers.

                  这是异常和堆栈跟踪:

                  System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
                  at System.Net.Mail.SmtpClient.Send(MailMessage message)
                  at ConsoleApplication1.Program.Main(String[] args) in E:devARCSoftware.FTPProcessorConsoleApplication1Program.cs:line 28
                  

                  我知道问题不是环境问题,因为我可以使用 Outlook Express 将这些确切设置发送到同一台服务器.我想知道我是否需要发送证书或其他什么?

                  I know the problem is not environmental though as I can send to the same server with these exact settings using Outlook Express. I am wondering if I need to send a certificate or something?

                  如果您或您认识的任何人对此有任何想法,我将不胜感激.

                  If you, or anyone you know where has any ideas about this I would greatly appreciate some help.

                  推荐答案

                  465不支持,但是下面的帖子详细介绍了一个解决方法

                  It's not supported through 465, but the following post details a workaround

                  我如何发送电子邮件通过带有 .NET Framework 的 SSL SMTP?

                  更新:此链接详细说明了为什么它可以通过 Outlook Express 工作,但不能通过 System.Net.Mail

                  UPDATE: This link details why it might work through Outlook Express, but not through the System.Net.Mail

                  http://blogs.msdn.com/b/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx

                  这篇关于雅虎邮箱的 C# SMTP 电子邮件发送代码失败,但适用于其他服务器,有人可以帮忙吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 列表框上的取消选择)
                    <bdo id='QUjVC'></bdo><ul id='QUjVC'></ul>
                    1. <legend id='QUjVC'><style id='QUjVC'><dir id='QUjVC'><q id='QUjVC'></q></dir></style></legend>
                        <tbody id='QUjVC'></tbody>

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

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