title: Email in angularjs?
body: <p>Below is the code I use to send email, but i don't know if it is correct. My application is based on angularjs 1.4.8.</p>
  
  <pre><code>[HttpPut]
  [Route("api/SendMail")]
  protected void sendmail()
  {
  
      var fromAddress = "xxxk@xxxxx.com";
      var toAddress = "rrrr@rrr.com";
      const string fromPassword = "workufs1234";
      MailMessage mailMessage = new MailMessage(fromAddress, toAddress);
      mailMessage.To.Add(toAddress);
      mailMessage.Subject = "Documents";
      string messge = "hellooooo";
      string tempmsg = "";
      var messg = @"&lt;html&gt;&lt;body&gt;&lt;br /&gt;Dear  ss ,&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;";
      mailMessage.To.Add(toAddress);
      string html = messg.ToString();
      AlternateView altView = AlternateView.CreateAlternateViewFromString(html, null, MediaTypeNames.Text.Html);
      MailMessage mail = new MailMessage();
      mailMessage.AlternateViews.Add(altView);
      mailMessage.Body = messg.ToString();
      mailMessage.IsBodyHtml = true;
  
      SmtpClient mailSender = new SmtpClient("162.222.225.82"); //use this if you are in the development server
      mailSender.Host = "smtp.gmail.com";
      mailSender.Port = 587;
      mailSender.EnableSsl = true;
      mailSender.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
      mailSender.Credentials = new NetworkCredential(fromAddress, fromPassword);
      mailSender.Timeout = 40000;
      mailSender.Send(mailMessage);
  }
  </code></pre>
  
  <p>How can I test the webapi?</p>