Email Security Exception in ASP.NET -
security exceptiondescription: application attempted perforanoperation not allowed by`the security policy. grant application required permission please contact system administrator or change application's trust level in configuration file.
exception details: system.security.securityexception: request permission of type 'system.net.mail.smtppermission, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' failed. source error: line 45: { line 46: smtp.host = "smtp.gmail.com"; line 47: smtp.port = 587; line 48: smtp.enablessl = true; line 49: smtp.deliverymethod = system.net.mail.smtpdeliverymethod.network; source file: d:\inetpub\vhosts\softsoftware.in\designscentre\asktheexpert.aspx.cs line: 47 stack trace: [securityexception: request permission of type 'system.net.mail.smtppermission, system, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089' failed.] system.security.codeaccesssecurityengine.check(object demand, stackcrawlmark& stackmark, boolean ispermset) +0 system.security.codeaccesspermission.demand() +61 system.net.mail.smtpclient.set_port(int32 value) +106 asktheexpert.sendbtn_click(object sender, eventargs e) in d:\inetpub\vhosts\softsoftware.in\designscentre\asktheexpert.aspx.cs:47 system.web.ui.webcontrols.button.onclick(eventargs e) +111 system.web.ui.webcontrols.button.raisepostbackevent(string eventargument) +110 system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string eventargument) +10 system.web.ui.page.raisepostbackevent(ipostbackeventhandler sourcecontrol, string eventargument) +13 system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +36 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +6785 system.web.ui.page.processrequest(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +242 system.web.ui.page.processrequest() +80 system.web.ui.page.processrequestwithnoassert(httpcontext context) +21 system.web.ui.page.processrequest(httpcontext context) +49 asp.asktheexpert_aspx.processrequest(httpcontext context) in app_web_vkk6wpqv.2.cs:0 system.web.callhandlerexecutionstep.system.web.httpapplication.iexecutionstep.execute() +181 system.web.httpapplication.executestep(iexecutionstep step, boolean& completedsynchronously) +75 version information: microsoft .net framework version:2.0.50727.5485; asp.net version:2.0.50727.5483
security exceptiondescription: application attempted perforanoperation not allowed by`the security policy. grant application required permission please contact system administrator or change application's trust level in configuration file.
website work in localhost correctly. error on server . please me how solve error.
Comments
Post a Comment