title: Get all emails in inbox .Net.Mail C#
body: <p>I'm making a small program that can send emails and read emails. I can currently send emails however I'm not sure how I can access my inbox using .Net.Mail. Is there a way of doing this?</p>
  
  <p>My code is as fallows</p>
  
  <pre><code>try
  {
      SmtpClient mySmtpClient = new SmtpClient("smtp.live.com");
  
      // set smtp-client with basicAuthentication
      mySmtpClient.UseDefaultCredentials = false;
      System.Net.NetworkCredential basicAuthenticationInfo = new
          System.Net.NetworkCredential("example@live.com", "password");
      mySmtpClient.Credentials = basicAuthenticationInfo;
      mySmtpClient.EnableSsl = true;
  
      // add from,to mailaddresses
      MailAddress from = new MailAddress("example@live.com");
      MailAddress to = new MailAddress("example@example.eu");
      MailMessage myMail = new System.Net.Mail.MailMessage(from, to);
      MailMessage msg; 
  
      // set subject and encoding
      myMail.Subject = "Test message";
      myMail.SubjectEncoding = System.Text.Encoding.UTF8;
  
      // set body-message and encoding
      myMail.Body = "&lt;b&gt;Test Mail&lt;/b&gt;&lt;br&gt;using &lt;b&gt;HTML&lt;/b&gt;.";
      myMail.BodyEncoding = System.Text.Encoding.UTF8;
      // text or html
      myMail.IsBodyHtml = true;
  
      mySmtpClient.Send(myMail);
  }
  
  catch (SmtpException ex)
  {
      throw new ApplicationException
          ("SmtpException has occured: " + ex.Message);
  }
  </code></pre>