title: SmtpClient Sending bad MessageIDs
body: <p>I've written an automated e-mailer for my company's invoices. Things are all fine and dandy till I ran across a couple emails that weren't getting delivered.</p>
  
  <p>Upon further inspection our IT Guru found that the messages sent by the emailer have incorrect MessageID headers.</p>
  
  <p><code>Message-ID: &lt;98bcd4e6-be30-4b22-8026-6047c8231b1f&gt;</code></p>
  
  <p>Where they should look something like this:</p>
  
  <p><code>Message-ID: &lt;F09A215A213060419E28A88E85FDC8FD0CCEB91C23@EXCHANGE-SERVER.MYDOMAIN.mycompany.com&gt;</code></p>
  
  <p>I've looked around the internet for 'invalid message-id' related to .NET's SqlClient with no success. This is prettymuch the last lynch-pin in this whole system, hopefully there's an answer out there.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>MailMessage message = new MailMessage();
  
  foreach(string recipient in msgRecipients)
  {
      message.To.Add(new MailAddress(recipient));
  }
  
  message.From = new MailAddress(InvoiceEmailerConfig.Section.EmailCourier.FromEmail);
  message.ReplyTo = new MailAddress(InvoiceEmailerConfig.Section.EmailCourier.ReplyToEmail);
  message.Subject = messageHeading;
  message.Body = msgBody;
  
  SmtpClient mailer = new SmtpClient(SmtpServer, SmtpServerPort);
  mailer.DeliveryMethod = SmtpDeliveryMethod.Network;
  mailer.Credentials = new NetworkCredential(SmtpLogin, SmtpPassword);
  mailer.Send(message);
  </code></pre>