title: C# how to send email?
body: <p>I am using C#.NET 4.0 and would like to send an email to an address with a subject and a body, the body will contain some information from a few text-boxes in my application.</p>
  
  <p>I have little to no experience with sending emails in C#, so any help here would be appreciated. All I know is that you have to use the System.Net.Mail namespace. I tried this code but it gave an "Failure sending Mail" exception.</p>
  
  <pre><code>        new SmtpClient("smtp.server.com", 25).Send("test@hotmail.com",
                                         "test@gmail.com",
                                         "subject",
                                         "body");
  </code></pre>
  
  <p>What is wrong with the above code? Furthermore, is there any better way to send the email?</p>