0

好的,所以我尝试了很多方法来发送这封电子邮件,但我就是无法收到,这是服务提供商提供的仅有的两个

交换服务器的 url

EXVMBX016-3.exch016.msoutlookonline.net

通过 http 连接的代理

dc016-8.exch016.msoutlookonline.net

注意:我尝试使用 SSL

现在我的问题是,在我理解的默认端口中,它是25被拒绝的连接,所以我打开了我的 Outlook 并使用嗅探器尝试查看该 url 中打开的端口是什么,这是135超时。

 System.Net.NetworkCredentialnetworkCredentials = new System.Net.NetworkCredential("example@example.com", "*****");
 System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
 message.To.Add("example@example.com");
 message.Subject = "Esto es una prueba de direccion";
 message.From = new System.Net.Mail.MailAddress("example@example.com");
 message.Body = "Esto es una prueba del servicio de direcciones";
 System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("EXVMBX016-3.exch016.msoutlookonline.net");
 //smtp.Port = 135
 //smtp.EnableSsl = False
 smtp.UseDefaultCredentials = false;
 smtp.Credentials = networkCredentials;
 smtp.Send(message);

所以如果我错过了什么?或者我做错了什么?

更新 这是我在 Outlook 上的配置的一些图片

服务器网址

代理人

4

1 回答 1

0

您的问题是您使用了错误的 SMTP 地址。根据我的理解,Exchange Server 名称不能是 SMTP 名称 cEXVMBX016-3.exch016.msoutlookonline.net。您的 SMTP 服务器地址将不同于您在上面使用的地址,这就是连接被拒绝的原因。发送任何电子邮件时,您只需要正确的 SMTP 地址和正确的凭据来连接它,就是这样。我相信你的代码是正确的。

要获得正确的 SMTP 地址,请在 Outlook 中打开您的电子邮件地址联系人卡片,然后查找“电子邮件地址”属性,您将获得正确的 SMTP 地址并在上述代码中使用。

[添加以上图片后添加]

根据上图,您使用 Exchange Server Address 作为 SMTP 地址,这是错误的。您必须从 IT 获得正确的 SMTP 地址,然后使用该地址发送电子邮件。您的代码是正确的,因此正确的 SMPT 地址将立即生效。

于 2012-05-30T22:10:54.383 回答