title: http 500 internal server error how to fix
body: <p>I am having a problem "500 Internal Server Error" when I used web service call. What is causing this problem? How to resolve it?</p>
  
  <p>Please advise me..</p>
  
  <p>Here's my code:</p>
  
  <pre><code>   MailMessage objEmail = new MailMessage(new MailAddress(ConfigurationManager.AppSettings["emailAdd"].ToString()), new MailAddress(ConfigurationManager.AppSettings["emailAdd"].ToString()));
      objEmail.Subject = "Test";
      objEmail.Body = "EJSCODE:" + _Message;
      objEmail.Priority = MailPriority.High;
      SmtpClient SmtpMail = new SmtpClient();
      SmtpMail.Host = "localhost";
      SmtpMail.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
      SmtpMail.PickupDirectoryLocation = @"C:\Inetpub\wwwroot\MailMsg2"; 
      SmtpMail.Send(objEmail);
  </code></pre>