public ActionResult SendMail()
{
MailMessage mss = new MailMessage();
mss.From = new MailAddress("Grace_cai01@infosys.com");
mss.Body = "testtesttesttesttest";
mss.BodyEncoding = Encoding.UTF8;
mss.IsBodyHtml = false;
mss.To.Add(new MailAddress("Grace_cai01@infosys.com"));
SmtpClient cliente = new SmtpClient();
cliente.Host = ConfigurationManager.AppSettings["Host"].ToString();
cliente.Port = int.Parse(ConfigurationManager.AppSettings["Port"].ToString());
cliente.UseDefaultCredentials = ConfigurationManager.AppSettings["EnableSsl"].ToString() == "" ? false : true;
cliente.EnableSsl = false;
string Username = ConfigurationManager.AppSettings["Username"].ToString();
string Password = ConfigurationManager.AppSettings["Password"].ToString();
System.Net.NetworkCredential credenciais =
new System.Net.NetworkCredential(Username, Password);
cliente.Credentials = credenciais;
cliente.Send(mss);
return Content("ok");
}