有沒有人曾經嘗試發送電子郵件使用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