2011-03-10 23 views
0

我們正在使用critsend的SMTP服務器作爲我們的新聞通訊。在System.Net.NetworkCredential中使用標準.NET SmtpClient,但我們無法使其與MailBee的SmtpServer對象一起工作。因爲服務器回答 「服務器不支持STARTTLS(STLS爲POP3)命令。」如何關閉MailBee.NET SMTP對象中的StartTLS

下面的代碼失敗:

SmtpServer smtpServer = new SmtpServer("smtp.critsend.com"); 
smtpServer.Port = 587; 

smtpServer.AccountName = "MY NAME"; 
smtpServer.Password = "MY PASSWORD"; 

Smtp.LicenseKey = "MY KEY"; 
Smtp smtp = new Smtp(); 
smtp.SmtpServers.Add(smtpServer); 
MailMessage mailMessage = new MailMessage(); 
mailMessage.To.Add("MY EMAIL"); 
mailMessage.Subject = "Test"; 
mailMessage.From.Email = "MY EMAIL"; 
smtp.Message = mailMessage; 
smtp.Send(); 

設置smtpServer.SslMode = SslStartupMode.Manual沒有幫助。我如何關閉StartTLS?

我們使用的是MailBee.NET.5.5.2.138。

任何幫助是極大的讚賞。

回答

1

長期的試驗和錯誤的會議後,我們終於想出了一個解決方案。必須將以下屬性添加到SmtpServer:

smtpServer.AuthMethods = AuthenticationMethods.SaslPlain; 
1

按照docs下面應該工作:

smtpServer.SslMode = UseStartTlsIfSupported; 
+0

這很有道理。但是,這隻在比我們更新的版本中支持......我應該檢查。我們會更新。非常感謝! – Olaf 2011-03-10 14:02:12

+0

進一步的研究和切換到MailBee的版本6.表明這不是原因。對不起,太快了。 – Olaf 2011-03-11 11:02:54