title: asp.net mvc Send form from site to email
body: <p>I have feedback form on my mvc site, it looks like</p>
  
  <p><img src="https://i.stack.imgur.com/AJ7Ne.png" alt="enter image description here"></p>
  
  <p>I created model for my form</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  
  namespace ComponentTrading.Web.Models
  {
  public class FeedbackForm
      {
      public string Name { get; set; } 
      public string Email { get; set; } 
      public string Phone { get; set; }
      public string Message { get; set; }
      }
  }
  </code></pre>
  
  <p>I created view for my form</p>
  
  <pre><code> @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "contact-form" }))
                      {
                      &lt;fieldset&gt;
                      @Html.TextBoxFor(model =&gt; model.Name, new { @Value = "Name" })
                      @Html.TextBoxFor(model =&gt; model.Email, new { @Value = "E-mail" })
                      @Html.TextBoxFor(model =&gt; model.Phone, new { @Value = "Phone" })
                      @Html.TextAreaFor(model =&gt; model.Message, new { @class = "img-shadow"})
                      &lt;input class="form-button" data-type="reset" value="Clear" /&gt;
                      &lt;input class="form-button" data-type="submit" type="submit" value="Send" /&gt;
  </code></pre>
  
  <p><br>
                          }</p>
  
  <p>and now i try to do a sending a letter to email, but it doesn work, when I push "send-button" it happens nothing and I dont get email</p>
  
  <p>my controller</p>
  
  <pre><code>    [HttpGet]
      public ActionResult Contacts()
      {
          FeedbackForm temp = new FeedbackForm();
          temp.Message = "Message";
          return View(temp);
      }
  
  
      [HttpPost]
      public ActionResult Contacts(FeedbackForm Model)
      {
          string Text = "&lt;html&gt; &lt;head&gt; &lt;/head&gt;" +
          " &lt;body style= \" font-size:12px; font-family: Arial\"&gt;"+
          Model.Message+
          "&lt;/body&gt;&lt;/html&gt;";
  
          SendEmail("mironny@inbox.ru", Text);
          FeedbackForm temp = new FeedbackForm();
          return View(temp);
      }
  
  
      public static bool SendEmail(string SentTo, string Text)
      {
          MailMessage msg = new MailMessage();
  
          msg.From = new MailAddress("Test@mail.ru");
          msg.To.Add(SentTo);
          msg.Subject = "Password";
          msg.Body = Text;
          msg.Priority = MailPriority.High;
          msg.IsBodyHtml = true;
  
          SmtpClient client = new SmtpClient("smtp.mail.ru", 25);
  
  
  
          client.UseDefaultCredentials = false;
          client.EnableSsl = false;
          client.Credentials = new NetworkCredential("TestLogin", "TestPassword");
          client.DeliveryMethod = SmtpDeliveryMethod.Network;
          //client.EnableSsl = true;
  
          try
          {
              client.Send(msg);
          }
          catch (Exception)
          {
              return false;
          }
          return true;
      }
  </code></pre>
  
  <p>what's wrong?</p>