.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

I don't have "System.Net.Mail.SmtpPermission" ?

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
 
My project works well (send e-mail) in local PC, but it can not when uploaded. I have checked SMTP port again and again, port 3535 is open. May the problem caused by config file? I think no. Appreciate all the help, thank you so much and hope to hear from you soon!   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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Source Error: Line 66: SmtpClient client = new SmtpClient(); Line 67: client.Credentials = new System.Net.NetworkCredential(SMTP_USERNAME, SMTP_PASSWORD); Line 68: client.Port = 3535; //SMTP_PORT Line 69: client.Host = SMTP_HOST; Line 70: client.EnableSsl = ENABLE_SSL; Source File: d:\hosting\clearpathadmin\contact-us.aspx.cs    Line: 68 Stack Trace: [SecurityException: Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Security.CodeAccessSecurityEngine.Chec


View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend