Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Security Exception
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.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:


Line 25: SmtpClient smtp = new SmtpClient();
Line 26: smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
Line 27: smtp.Port = 587;
Line 28: smtp.EnableSsl = true;
Line 29: smtp.Credentials = new System.Net.NetworkCredential("rojgarjob@gmail.com", "myPassword");


Source File: d:\hosting\11709406\html\rojgar\ContactUs.aspx.cs Line: 27
Posted
Updated 28-Oct-13 21:34pm
v2
Comments
Richard MacCutchan 29-Oct-13 5:25am    
Do what the message tells you: change the trust level, or contact the administrator who can do it for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900