如何从 MS Exchange 发送接收邮件

发布于 2024-08-19 20:09:02 字数 294 浏览 4 评论 0原文

如何从自定义 C# 应用程序创建 MS Exchange 并发送/接收邮件?

我假设这不是直接的 可以使用标准框架 邮件课程。

如果我可以说这需要与 MS Exchange 2003 和 2007 一起使用,我有哪些选择?

理想情况下,我不想购买第三方组件,因此如果使用 c# 可以实现这一点,那么创建可以发送新邮件或将邮件接收到自定义应用程序的库的步骤是什么。

C# 应用程序将位于本地,就像与 Exchange 服务器位于同一网络中一样。

How can I , from a custom c# application, create and send/receive mails from MS Exchange?

I am assuming this is not directly
possible with the standard framework
mail classes.

If I could say that this needs to work with MS Exchange 2003 and 2007 what are my options?

Ideally I dont want to buy a third party component so if this is possible with c# then what are the steps for creating a library that can send a new mail or receive a mail into a custom application.

The C# app will be local, as in the same network as the Exchange server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

萌酱 2024-08-26 20:09:02

您是否尝试过使用内置的 .Net 邮件程序集?

如果创建 SmtpClient client = new SmtpClient("my-email-server"),smtp.Send 不起作用吗?

----- 使用代码

如果机器有邮件帐户设置,则不会,只要您设置 DefaultNetworkCredentials,它就应该使用系统中的邮件帐户:

SmtpClient smtp = new SmtpClient("mailserver"); 
smtp.Credentials = CredentialCache.DefaultNetworkCredentials; 

不过您可以创建一些并使用它们:

SmtpClient client = new SmtpClient("myserver"); 
client.Credentials = new NetworkCredential("username", "password", "domain");

Have you tried using the built-in .Net mail assemblies?

If you create an SmtpClient client = new SmtpClient("my-email-server"), does smtp.Send not work?

----- with code

If the machine has a mail account setup then no, it should use the ones from the system so long as you set DefaultNetworkCredentials:

SmtpClient smtp = new SmtpClient("mailserver"); 
smtp.Credentials = CredentialCache.DefaultNetworkCredentials; 

You can create some though and use those instead:

SmtpClient client = new SmtpClient("myserver"); 
client.Credentials = new NetworkCredential("username", "password", "domain");
瑶笙 2024-08-26 20:09:02

您是否将以下代码放入您的 web.config 文件中?

<system.net><mailSettings><smtp><network 
  host="host.name.com" port="port number"
  userName="username" password="password"/></smtp></mailSettings></system.net>

Have you put the following code in your web.config file?

<system.net><mailSettings><smtp><network 
  host="host.name.com" port="port number"
  userName="username" password="password"/></smtp></mailSettings></system.net>
2024-08-26 20:09:02

有许多途径可供查看:MAPI、CDO、第 3 方库等。

您正在使用的 Exchange 版本是什么,因为我认为 2007 年有一些 Web 服务可供您使用 OWA 插入的服务。

There's a number of routes to look at: MAPI, CDO, 3rd party libraries etc.

What version of Exchange is it you're working with as I think 2007 has some web services that you can use that OWA plugs in to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文