title: ConfigurationManager.AppSettings["SMTP"]; null exception
body: <p>i took this code to send an email. But i dont understand what that configurationManager does, and why it gives me the exception. Here is the full code:</p>
  
  <pre><code>        MailMessage mail = new MailMessage();
  
      mail.To.Add("makovetskiyd@yahoo.co.uk");
  
      mail.From = new MailAddress("makovetskiyd@yahoo.co.uk");
  
      mail.Subject = "Test Email";
  
      string Body = "Welcome to CodeDigest.Com!!";
  
      mail.Body = Body;
  
      SmtpClient smtp = new SmtpClient();
  
      smtp.Host = ConfigurationManager.AppSettings["SMTP"];
  
      smtp.Send(mail);
  </code></pre>
  
  <p>i also changed the last lines to this:
     smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;</p>
  
  <pre><code>        smtp.Send(mail);
  </code></pre>
  
  <p>but it would still show a mistake, saying it didnt find IIS server..or something like that</p>