The specified string is not in the form required for an e-mail address. with valid address
<p>I am developing a software which send email after the user pressed a button.
I encounter some issues with these emails: they <strong>sometimes</strong> raise this exception: <code>The specified string is not in the form required for an e-mail address.</code>. I emphasise on <strong>sometimes</strong> because they actually works sometimes.</p>

<p>Surprising thing is that the mail addresses are actually correctly formatted: they all look like <code>blahblah@domain.com</code> or <code>Blah Blah &lt;blahblah@domain.com&gt;</code>. This even happens with some of my company's mails, which - of course - are valid. I even checked all the addresses with this regex and they <strong>all</strong> passed: <code>^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$</code>.</p>

<p>Here are the steps my software is going through:</p>

<ol>
<li><p><strong>Add the main address</strong>:</p>

<pre><code>var mail = new MailMessage(new MailAddress("logistics@company.com", "company logistics department"), new MailAddress(address));
</code></pre></li>
</ol>

<p>Here the <code>address</code> is valid since the software did send an email to this address prior to this step.</p>

<ol start="2">
<li><p><strong>In a loop I add the CCs addresses</strong>:</p>

<pre><code>mail.CC.Add(new MailAddress(email));
</code></pre></li>
</ol>

<p>Here I applied a null/empty check so I am not adding any empty mail address.</p>

<ol start="3">
<li><p><strong>And finally I add myself in BCC address</strong>:</p>

<pre><code>mail.Bcc.Add("my@company.com");
</code></pre></li>
</ol>

<p>Is there any issue in the way I'm doing this ?</p>

<p>Are there some known issues (additionnaly random ones) about the C# .NET mail class?</p>

<p>Is there a limit on the maximum amount of To / CC / Bcc addresses this class can handle ?</p>

<p>EDIT: i'm using System.Net.Mail classes</p>