如何使用C#针对Exchange

如何使用C#针对Exchange

本文介绍了如何使用C#针对Exchange Server发送/接收电子邮件(不使用SMTPClient类)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用C#为我的公司开发一个电子邮件系统,我可以处理设置为"SMTP"的电子邮件。和"POP3"。 但是在尝试向Exchange Server2007发送/接收电子邮件时遇到问题(我的公司没有启用交换pop / smtp服务)。 

这是我的理解:
Exchange Server是一个软件,它使用它的方式来获取/发送电子邮件。对吗?
为什么交换服务器中没有设置"SMTP"的设置?和"POP3",你能告诉我机会吗?

1。如果我们公司不启用Exchange服务器的SMTP / POP3服务,我怎样才能使用c#发送/接收电子邮件到交换服务器。

通常,我在C#中编写如下代码用于SMTP

发送("HELO"+ DNS.GetHostname()  +" \\\\ n")
发送("Auth"" \\\ \\ n \\ n")发送(用户名+" \\\ n \ n \\ n")
发送(pwd +" \\\\ n \\ n")
发送(" FROM: " +  toReceipient  +" \\\\ n")
发送(....)//其他SMTP命令。

BTW,谢谢。

解决方案

Hi,

I'm developing a email system for my company using C#, I can handle the email with setting as "SMTP" and "POP3".  But I encounter a problem when trying to Send / Receive email against Exchange Server2007(My company does not enable exchange pop/smtp service). 

Here is my understanding:
Exchange Server is a software, it uses its way to get/send email. Right?
Why there is no setting in exchange server for "SMTP" and "POP3", would you please tell me the machenism?

1. If our company won't enable exchange server's SMTP/POP3 service, how can I use c# to send / recevie email to exchange server.

Usually, I do write a code in C# like below for SMTP

send("HELO " + DNS.GetHostname() + "\r\n")
send("Auth ""\r\n")
send(username + " \r\n")
send(pwd + " \r\n")
send("FROM: " + toReceipient +" \r\n")
send(....) // other SMTP commands.


BTW,
I don't want to use SMTPClient provided by .net framework 3.5 to implement.  I prefer to use Socket or TcpClient, that's why I write the code as above. :-)


Thanks.

解决方案


这篇关于如何使用C#针对Exchange Server发送/接收电子邮件(不使用SMTPClient类)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 02:45