如何使用Exchange 2007和C#在域外发送电子邮件 [英] How do I send emails outside my domain with Exchange 2007 and c#

查看:99
本文介绍了如何使用Exchange 2007和C#在域外发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要发件人和收件人地址都在我的域之内,我就可以在整个Exchange 2007中使用典型的C#SMTP代码发送电子邮件.

I am able to send emails using the typical C# SMTP code across Exchange 2007 as long as both the from and to addresses are within my domain.

一旦我尝试在域外发送电子邮件,我就会收到:

As soon as I try to send emails outside the domain I get:

异常详细信息:System.Net.Mail.SmtpFailedRecipientException:邮箱不可用.服务器响应为:5.7.1无法中继

Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay

我该如何交换以接受我的电子邮件并将其发送到互联网?

How can I get exchange to accept my email and send it out to the internet?

推荐答案

尝试#2 ...如何使用

Try #2... How about using a Exchange Pickup Folder instead? They are a faster way to send emails through Exchange because it just creates the email and drops it in the folder, no waiting to connect to the server or waiting for a reply. Plus I think it skips the whole relay issue.

像这样配置您的SmtpClient:

Configure youur SmtpClient like so:

SmtpClient srv = new SmtpClient("exchsrv2007", 25) {
    DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory,
    PickupDirectoryLocation = "\\exchsrv2007\PickupFolder"
}
...

这篇关于如何使用Exchange 2007和C#在域外发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆