title: C# WPF - How to send an e-mail (to myself)?
body: <p>for debugging purposes, I have globally handled all exceptions. Whenever an exception occurs, I silently handle it, and want to send myself an e-mail with the error details, so I can address this issue.</p>
  
  <p>I have two emails, email1@gmail.com, and email2@gmail.com...</p>
  
  <p>I have attempted using this code to send myself an e-mail, but it is not working.</p>
  
  <pre><code>        string to = "email1@gmail.com";
          string from = "email2@gmail.com";
          string subject = "an error ocurred";
          string body = e.ToString();
          MailMessage message = new MailMessage(from, to, subject, body);
          SmtpClient client = new SmtpClient("smtp.google.com");
          client.Timeout = 100;
          client.Credentials = CredentialCache.DefaultNetworkCredentials;
          client.Send(message);
  </code></pre>
  
  <p>I have tried countless other pieces of code but I have no idea how to do it. Does anyone have a solid solution for this? Thanks a bunch.</p>