Questions tagged «mailkit»

2
我可以通过Office365共享邮箱发送SMTP电子邮件吗?
我们正在考虑迁移到O365;但是,我们开发了使用当前Exchange服务器将错误发生时既发送给外部用户又发送给支持箱的电子邮件的软件。 我已经对此进行了测试,以确保我们已有的代码将继续与O365配合使用,但到目前为止,我还没有取得很大的成功。 我尝试过使用.Net的SmtpClient以及MailKit的SmtpClient,但似乎都无法使用。我不断收到错误消息(这是MailKit发出的错误-.Net错误类似) “ AuthenticationInvalidCredentials:5.7.3身份验证失败[* .prod.exchangelabs.com]” 我可以使用代码中的凭据登录OWA,因此我知道这些凭据是有效的。无法通过O356发送电子邮件吗?为了使之成为可能,Exchange中是否必须进行任何特殊配置? 到目前为止,这是我尝试过的: MailKit var msg = new MimeMessage(); msg.From.Add(new MailboxAddress("Support","support@mydomain.com")); msg.To.Add(new MailboxAddress("Me","me@mydomain.com")); msg.To.Add(new MailboxAddress("External User","euser@externaldomain.com")); msg.Subject = "Test"; msg.Body = new TextPart("plain"){ Text = "Here is a message for you" }; using(var client = new SmtpClient()){ client.ServerCertificateValidationCallback = (s,c,h,e) => true; client.AuthenticationMechanisms.Remove("XOAUTH2"); //Not sure …
13 c#  .net  smtp  office365  mailkit 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.