1

嗨,我在会员申请中实现“向会员发送电子邮件”功能时遇到了以下问题。我做了一些研究并添加

             <system.web>
             <securityPolicy>
                <trustLevel name="Full" policyFile="internal"/>
             </securityPolicy>
            </system.web> 

到我的Web.config,然后再次部署到服务器,但问题仍然存在。有任何想法吗?提前致谢。

   Server Error in '/TestApp' Application.

   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: 

   An unhandled exception was generated during the execution of the current web request. Information  regarding the origin and location of the exception can be identified using the exception stack trace below.
4

1 回答 1

1

发送电子邮件时,您可能指定了可能不允许的 SMTP 端口号。

这是我正在谈论的示例: SecurityException:请求“System.Net.Mail.SmtpPermission”类型的权限

于 2013-08-01T21:38:21.143 回答