Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I tried to reproduce this in Visual Studio 2012, but even when I set the compiler to use <code>.NET 2.0</code> I still did not encounter this issue.</p> <p>It is possible that you are missing the reference for <code>System.dll</code> which includes the namespace <code>System.Net.Mail</code>. Just as an precaution as you didn't include any sample code I will include a simple implementation of a Mail client as an example.</p> <pre><code>using (SmtpClient client = new SmtpClient("smtp-server.MyDomain.com")) { client.UseDefaultCredentials = true; using (MailMessage mail = new MailMessage()) { mail.Subject = subject; mail.Body = body; mail.From = new MailAddress("MyEmail@MyDomain.com"); mail.To.Add("ToThisEmail@MyDomain.com"); client.Send(mail); } } </code></pre> <p>Even though I wasn't able to reproduce this I would still recommend that you verify that you are compiling your project against the same target framework as your previous client.</p> <p>You can do this by right-clicking on your project and selecting <code>Target framework</code> under the <code>Application</code> tab.</p> <p><strong>Edit:</strong> It might be worth taking a screenshot of your current references and uploading it here at stackoverflow. It would give us an better overview of potential issues or conflicts.</p> <p><img src="https://i.stack.imgur.com/bePc5.png" alt="enter image description here"></p> <p>There should be no need to modify your <code>App.config</code>, but as a reference here you have mine.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;startup&gt; &lt;supportedRuntime version="v2.0.50727"/&gt;&lt;/startup&gt; &lt;/configuration&gt; </code></pre> <p><strong>Edit2:</strong></p> <p><strong>Add the <code>System.dll</code> reference.</strong></p> <ol> <li>Right click on your project and choose <code>Add Reference</code>. </li> <li>Find and add <code>System</code> (or <code>System.dll</code>) under <code>Assemblies</code> and <code>Framework</code>. </li> <li>Click <code>OK</code> to save.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload