title: When does the empty MailMessage constructor work?
body: <p>We have an Asp.Net solution that's been in production for over 2 years using System.Net.Mail.MailMessage with the empty constructor:</p>
  
  <pre><code>using (MailMessage _mailMessage = new MailMessage()) // Exception thrown here
  {
    _mailMessage.From = new MailAddress(sFrom); // Setting additional properties - never gets here
    _mailMessage.Body = sBody;
    _mailMessage.Subject = sSubject;
    _mailMessage.IsBodyHtml = true;
  </code></pre>
  
  <p>Yesterday we had a live site report the exception: The specified string is not in the required form for an email address. We fixed it by adding the required  node to the web.config file.</p>
  
  <p>The question is: Why did this ever work? or Could it have ever worked?</p>
  
  <p>Error:
  The specified string is not in the form required for an e-mail address.
     at System.Net.Mail.MailAddressParser.ReadCfwsAndThrowIfIncomplete(String data, Int32 index)
     at System.Net.Mail.MailAddressParser.ParseDomain(String data, Int32&amp; index)
     at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32&amp; index)
     at System.Net.Mail.MailAddressParser.ParseAddress(String data)
     at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
     at System.Net.Mail.MailMessage..ctor()</p>
  
  <p>Thanks</p>
  
  <p><strong>EDITS</strong>: </p>
  
  <ul>
  <li>We updated from .net 3.5 to 4.0 last month!</li>
  <li>Added stack trace</li>
  <li>After 7 months, the error only occurs on some servers. Why?</li>
  </ul>