title: 1&1 web hosting and smtp configuration
body: <p>Has anyone ever tried sending emails using 1&amp;1 smtp host? I tried the following?</p>
  
  <pre><code>SmtpClient mailClient = new SmtpClient("smtp.1and1.com", 587);
  mailClient.Credentials = new NetworkCredential("admin@permias-tucson.com", "password");
  </code></pre>
  
  <p>But it always gives me a security exemption error...</p>
  
  <p>I tried it using my local host and it works fine.. I tried using gmail's smtp and it worked fine as well.. It says that I need to authenticate in order to use the smtp server, I did that  by looking at the code above... Here's the exact error:</p>
  
  <blockquote>
    <p>Security Exception</p>
    
    <p>Description: The application attempted
    to perform an operation not allowed by
    the security policy.  To grant this
    application the required permission
    please contact your system
    administrator or change the
    application's trust level in the
    configuration file. </p>
    
    <p>Exception Details:
    System.Security.SecurityException:
    Request for the permission of type
    'System.Net.Mail.SmtpPermission,
    System, Version=2.0.0.0,
    Culture=neutral,
    PublicKeyToken=b77a5c561934e089'
    failed.</p>
  </blockquote>