Im Using asp.net 3.5. My SMTP Email works in Full trust though just not in Medium trust level.
So my SMTP works in Full trust, however when i change the trust level to "Medium" I get this error:
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.
public void SendEmail()
{
String EmailUser = ConfigurationManager.AppSettings["EmailUser"];
String EmailPW = ConfigurationManager.AppSettings["EmailPassword"];
MailMessage mail = new MailMessage("test@gmail.com", txbEmail.Text.Trim());
&n ...
Go to the complete details ...