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

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

        <tfoot id='L4b9N'></tfoot>

        C# 邮件程序 - 550 访问被拒绝 - HELO 名称无效

        时间:2023-10-05

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

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

                <tbody id='DBUZS'></tbody>
              <tfoot id='DBUZS'></tfoot>
                <legend id='DBUZS'><style id='DBUZS'><dir id='DBUZS'><q id='DBUZS'></q></dir></style></legend>

                1. 本文介绍了C# 邮件程序 - 550 访问被拒绝 - HELO 名称无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道存在与此问题相关的各种线程,但我无法在这些线程上获取任何响应并使其在我的服务器上运行.

                  所以让我们试着看看是否有人可以帮助我.99% 的电子邮件都能正常发送,而真正返回该错误的电子邮件很少.

                  我的代码是这样的

                   MailMessage mm = new MailMessage(Settings.EmailCustomerService, to, subject, body);mm.SubjectEncoding = 编码.UTF8;mm.BodyEncoding = 编码.UTF8;mm.IsBodyHtml = 真;MailAddress add = new MailAddress(Settings.EmailCustomerService, "客户服务");mm.From = 添加;尝试{SmtpClient 客户端 = 新 SmtpClient(Settings.EmailSMTP);client.UseDefaultCredentials = false;client.Credentials = new NetworkCredential(Settings.EmailUser, Settings.EmailPwd);System.Threading.ParameterizedThreadStart threadStart = new System.Threading.ParameterizedThreadStart(SendInThread);threadStart.Invoke(新的 SendInThreadParams{客户=客户,消息 = 毫米});}最后{毫米=空;}

                  实际上,凭据代码是后来添加的,但即使没有它,我的代码也可以正常运行.只是碰巧有 1% 的电子邮件从未发送给收件人,而添加这 2 行作为凭据并没有什么不同.

                  Settings.EmailUser 只是运行 SMTP 的服务器上的一个用户,但我没有将它附加到任何地方.

                  <块引用><块引用>

                  我敢打赌这就是问题所在.

                  SMTP 服务器中继设置为使用 127.0.0.1,而 FQDN 只是机器的名称(类似于Machine1"......没有 domain.com 名称)

                  我得到的错误是这样的

                  <块引用>

                  报告-MTA:dns;Machine1
                  Received-From-MTA: dns;Machine1
                  到达日期:2012 年 5 月 30 日,星期三 23:08:36 -0700
                  最终收件人:rfc822;test@email.net
                  行动:失败
                  状态:5.5.0
                  诊断代码:smtp;550 访问被拒绝 - HELO 名称无效(请参阅 RFC2821 4.1.1.1)

                  通过电子邮件返回的消息是:

                  <代码> >这是一个自动生成的传送状态通知.传递到下列收件人失败.test@email.com

                  在此先感谢...

                  解决方案

                  除了message/delivery-status附件,DSN一般都会有返回的message.对于此类问题,您应该发布返回邮件的标题和 DSN.

                  在我看来,您的服务器已接受该消息,但在继续传输时出错.如果您的服务器拒绝了它,您的代码将引发异常.因此,您的服务器 Machine1 接受了它,并试图将其传输到 email.net,但 email.net 拒绝了它.Machine1 然后生成了一个 DSN(交付状态通知,在您的情况下为 NDR = 未交付报告).

                  换句话说,这是电子邮件服务器的配置错误,而不是代码问题.几乎可以肯定,问题是电子邮件服务器没有按照您所说的那样设置 FQDN.

                  作为配置问题,属于ServerFault.

                  I know there are various thread out there related to this problem but i was unable to take any of the responses on those thread and make it work on my server.

                  So let try to see if someone can help me out here. 99% of the emails go out properly and few actually return with that error.

                  My code looks like this

                          MailMessage mm = new MailMessage(Settings.EmailCustomerService, to, subject, body);
                          mm.SubjectEncoding = Encoding.UTF8;
                          mm.BodyEncoding = Encoding.UTF8;
                          mm.IsBodyHtml = true;
                  
                          MailAddress add = new MailAddress(Settings.EmailCustomerService, "Customer Service");
                          mm.From = add;
                  
                          try
                          {
                              SmtpClient client = new SmtpClient(Settings.EmailSMTP);
                  
                              client.UseDefaultCredentials = false;
                              client.Credentials = new NetworkCredential(Settings.EmailUser, Settings.EmailPwd); 
                  
                              System.Threading.ParameterizedThreadStart threadStart = new System.Threading.ParameterizedThreadStart(SendInThread);
                              threadStart.Invoke(new SendInThreadParams
                              {
                                  client = client,
                                  Message = mm
                              });
                          }
                          finally
                          {
                              mm = null;
                          }
                  

                  Actually the Credentials code was added later but my code was run OK even without it. It just happen that 1% of the email never make it to the recipients and adding those 2 lines for Credentials did not make a difference.

                  The Settings.EmailUser is just a user on the server where the SMTP runs, but i have NOT attach it to nowhere.

                  I bet that's the problem.

                  The SMTP Server Relay is set to use 127.0.0.1 and the FQDN is just the name of the machine (something like "Machine1" ...nothing with a domain.com name)

                  The error I'm getting is this

                  Reporting-MTA: dns;Machine1
                  Received-From-MTA: dns;Machine1
                  Arrival-Date: Wed, 30 May 2012 23:08:36 -0700
                  Final-Recipient: rfc822;test@email.net
                  Action: failed
                  Status: 5.5.0
                  Diagnostic-Code: smtp;550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

                  Return message emailed back was:

                     > This is an automatically generated Delivery Status Notification.  
                     Delivery to the following recipients failed.  
                     test@email.com
                  

                  Thanks in advanced...

                  解决方案

                  In addition to the message/delivery-status attachment, the DSN will usually have the returned message. For this sort of issue you should post the headers of the returned message and the DSN as well.

                  It looks to me like your server has accepted the message, but has an error transmitting it onwards. If your server had rejected it, your code would have thrown an exception. So your server Machine1 accepted it, attempted to transmit it to email.net, but email.net rejected it. Machine1 then generated a DSN (delivery status notification, in your case an NDR = Non-Delivery Report).

                  In other words it is a configuration error with the email server not a code problem. Almost certainly the issue is that the email server is not set up with an FQDN as you stated.

                  As a configuration problem, it belongs on ServerFault.

                  这篇关于C# 邮件程序 - 550 访问被拒绝 - HELO 名称无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C# SMTP 身份验证失败,但凭据正确 下一篇:在 asp.net 中使用特定名称而不是发件人电子邮件发送电子邮件

                  相关文章

                  • <bdo id='c17Or'></bdo><ul id='c17Or'></ul>
                2. <tfoot id='c17Or'></tfoot>

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

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