有没有人曾经尝试发送电子邮件使用1 & 1 smtp主机?我尝试了以下?1&1网络托管和smtp配置
SmtpClient mailClient = new SmtpClient("smtp.1and1.com", 587);
mailClient.Credentials = new NetworkCredential("[email protected]", "password");
但它总是给我一个安全免除错误...
我尝试了用我的本地主机上工作得很好。我尝试使用Gmail的SMTP,它工作得很好,以及它..说我需要为了使用SMTP服务器进行身份验证,我也通过看上面的代码......这里是确切的错误:
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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
也许你应该联系1&1,以确保一切设置正确? – 2010-04-12 16:22:32
在英国,您需要使用auth.smtp.1and1.co.uk并提供您的帐户凭据以发送电子邮件。 – 2010-04-12 16:22:59
我确实在我使用的代码下面提供了我的凭据... – aherlambang 2010-04-12 16:28:07