title: Mail sending code works at local but not on server in asp.net mvc
body: <p>My mail sending code using google stmp in asp.net MVC works fine at local server but gives internal server error 500 at remote server  sage.arvixe.com</p>
  
  <p>Here Is my Controller Code:</p>
  
  <pre><code>    string email = "**@**.com";
      string password = "***";
  
      MailMessage mail = new MailMessage();
      SmtpClient SmtpServer = new SmtpClient("my.smtp.server.com");
  
      mail.From = new MailAddress(email, "Company");
      mail.To.Add("something@gmail.com");
      mail.Subject = "Feedback";
  
      string body = "CompanyName " + data.CompanyName + "&lt;br/&gt; Contact Person Name " + data.ContactPersonName + "&lt;br/&gt; Designation " + data.Designation + "&lt;br/&gt; EmailID " + data.EmailID + "&lt;br/&gt; MobileCellNo " + data.MobileCellNo + "&lt;br/&gt; OfficePhoneNo " + data.OfficePhoneNo + "&lt;br/&gt; FaxNo " + data.FaxNo + "&lt;br/&gt; Address " + data.Address + "&lt;br/&gt; CityState " + data.CityState + "&lt;br/&gt; PostalCode " + data.PostalCode + "&lt;br/&gt; Country " + data.Country + "&lt;br/&gt; Description " + data.Description + "";
      mail.Body = body;
      mail.IsBodyHtml = true;
      //SmtpServer.UseDefaultCredentials = false;
      SmtpServer.Port =25;
      SmtpServer.Credentials = new System.Net.NetworkCredential(email, password);
      //SmtpServer.EnableSsl = true;
      SmtpServer.Send(mail);
  </code></pre>