title: problem in sending email via SMTP service not as external senders
body: <p>I have a problem in sending email to one of my office distributed group. The issue is as below:</p>
  
  <blockquote>
    <p>Remote Server returned '550 5.7.133
    RESOLVER.RST.SenderNotAuthenticatedForGroup; authentication required;
    Delivery restriction check failed because the sender was not
    authenticated when sending to this group'</p>
  </blockquote>
  
  <p>By reading this blog (<a href="https://markgossa.blogspot.com/2015/11/your-message-wasnt-delivered-because-the-recipients-e-mail-provider-rejected-it.html" rel="nofollow noreferrer">Link</a>) and a few other posts, I understand in order to solve my problem, I need to run below command in Active Directory Server (ADS).</p>
  
  <pre><code>Set-DistributionGroup &lt;group_name&gt; -RequireSenderAuthenticationEnabled $false
  </code></pre>
  
  <p>which means, the problem is that the distribution group was created with default settings which means it doesn't receive email from <strong><em>external senders</em></strong>. </p>
  
  <p>My questions are:</p>
  
  <p>1- What does it mean <strong><em>"External Sender"</em></strong> that exchange does not accept my email in the above sentence?</p>
  
  <p>2- if I do not want to run above command, how my application can pretend as it is not an external sender? (please take note that when I used outlook I could send email to that DL email and it was successful but from my application I couldn't. please advice me.  </p>
  
  <p>my code is in below for your reference.</p>
  
  <pre><code>using (var client = new SmtpClient("14.19.21.23"))
              {
                  try
                  {
                      MailMessage newMail = new MailMessage();
                      newMail.From = new MailAddress("abc@company.com", "abc@company.com");
  
                      newMail.To.Add(new MailAddress("DL-team@company.com", "DL-Team"));
  
                      newMail.Subject = "subject";
                      newMail.Body = "Mail body";
                      newMail.SubjectEncoding = Encoding.UTF8;
  
                      newMail.IsBodyHtml = true;
                      client.UseDefaultCredentials = false;    // true is working
                      client.Credentials = new System.Net.NetworkCredential("username", "password", "companydomain");
                      client.DeliveryMethod = SmtpDeliveryMethod.Network;
  
                      client.Send(newMail);
                  }
                  catch (Exception ex)
                  {
                      throw new Exception("Sending mail failed due to :" + ex.Message, ex);
                  }
              }
  </code></pre>
  
  <p><strong>EDIT1:</strong>
  I observer that SMTP client is not using my credential! what I mean is that even if I use the wrong password there is no issue! any idea?
  Based on my research SMTP is using the easiest way to send mail, therefore it might use my PC details. can you share your idea? our company support below protocol[NTLM, GSSAPI]:</p>
  
  <pre><code>telnet 14.19.21.23 25
  220 *****************************
  EHLO www.Company.com
  250-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXA
  250-SIZE 37748736
  250-PIPELINING
  250-DSN
  250-ENHANCEDSTATUSCODES
  250-XXXXXXXB
  250-XXXXXXXXXXXXXC
  250-AUTH NTLM
  250-XXXXXXXXXXXXXXXXXD
  250-8BITMIME
  250-BINARYMIME
  250-XXXXXXXE
  250 XXXXF
  </code></pre>