title: An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll
body: <p>I'm trying out very simple tutorial on how to send e-mail via <code>.NET</code> and <code>C#</code>. However when I try to execute the code I got the following exception:</p>
  
  <blockquote>
    <p><strong>An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll Additional information: The operation has timed
    out.</strong></p>
  </blockquote>
  
  <p>So what I have done is to find the server settings to which I want to send mails to. This is very popular in my country:</p>
  
  <pre><code>Incoming settings
  
  Protocol -&gt; POP
  Email address -&gt; username@abv.bg
  Username -&gt; username@abv.bg
  Password -&gt; password
  POP server -&gt; pop3.abv.bg
  Security type -&gt; SSL
  Server port -&gt; 995
  
  Outgoing server settings
  
  Username -&gt; username@abv.bg
  Password -&gt; password
  SMTP server -&gt; smtp.abv.bg
  Security type -&gt; SSL
  Server port -&gt; 465
  </code></pre>
  
  <p>then I created a <code>Console project</code> and in my main method I have this code:</p>
  
  <pre><code>        SmtpClient client = new SmtpClient("smtp.abv.bg");
          client.Port = 465;
          client.EnableSsl = true;
          client.Timeout = 100000;
          client.DeliveryMethod = SmtpDeliveryMethod.Network;
          client.UseDefaultCredentials = false;
          client.Credentials = new NetworkCredential(
           "username@abv.bg", "password");
  
          MailMessage msg = new MailMessage();
          msg.To.Add("username@abv.bg");
          msg.From = new MailAddress("username@abv.bg");
          msg.Subject = "Test subject";
          msg.Body = "Test test test...";
          client.Send(msg);
  </code></pre>
  
  <p>Since I have no experience with this I just try the code as you see it. No additional settings anywhere. The only thing that I think should not be problem but I think worth mentioning that here:</p>
  
  <pre><code>         client.Credentials = new NetworkCredential(
           "username@abv.bg", "password");
  </code></pre>
  
  <p>and here:</p>
  
  <pre><code>         msg.To.Add("username@abv.bg");
  </code></pre>
  
  <p>I'm using the same e-mail. But I think this shouldn't be a problem. Any idea what am I doing wrong here?</p>