1and1 windows 托管与 asp.net

Dav*_*vid 1 asp.net trust hosting web-hosting system.net.mail

不确定是否有人使用过 1and1 MS Hosting 并遇到信任级别问题?

我只是尝试在 asp.net 中使用 system.net.mail 发送邮件(工作正常)但是当它与 1and1 联机时,我收到此错误:

说明:应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请联系您的系统管理员或在配置文件中更改应用程序的信任级别。

异常详细信息:System.Security.SecurityException:请求类型为“System.Net.Mail.SmtpPermission、System、Version=2.0.0.0、Culture=neutral、PublicKeyToken=b77a5c561934e089”的权限失败。

我问了 1and1,他们给我发了一个 machine.config 文件,里面有他们的设置,但没有解释如何处理它。

对不起,我不能再忍受无用的技术支持了。

任何人都知道我应该如何处理 machine.config 或其他什么?

Dav*_*vid 5

而答案是......

1and1 不允许访问 system.net.mail。但是请允许访问过时的 system.web.mail(哦,喜悦)

此处提供可用邮件服务器的基本说明