Send mails using EXCHANGE SERVER (Microsoft Outlook web access)in asp.net

我只是一个虾纸丫 提交于 2019-11-30 05:03:35

You can send emails using the Exchange Web Services API (EWS). EWS is a set of old fashioned ASMX web services hosted on the same server as OWA. Microsoft has even published an open source managed API wrapper on GitHub for EWS.

Here is an example on how to send emails using EWS: http://code.msdn.microsoft.com/Send-Email-with-Exchange-50189e57

The GitHub readme also includes links to samples.

Usually EWS can be found at http://yourexchangeserver/ews/exchange.asmx but with the managed API you can use autodiscovery to automatically find the address of EWS on your Exchange server.

Update regarding Exchange 2003:

You can access the Exchange 2003 mail store via HTTP using WebDAV. WebDAV is a bit of a pain to use because you may have to use Forms Based Authentication (FBA) if that is what your OWA installation requires (in comparison EWS can use Windows Authentication even if OWA on Exchange 2007/2010 is using FBA).

I have never tried sending mails using WebDAV for Exchange (although I have used WebDAV for a number of other things) but I found an example on MSDN that you may want to try. It uses Windows Authentication so it will not work if your Exchange 2003 OWA is set up to use FBA. If you need to use FBA let me know - I may have some sample code somewhere that you can use.

It is possible to send email through your organizations exchange server from asp.net, but you wouldn't want to use OWA.

There is a web site dedicated to .Net email that should give you some sample code. See: http://www.systemnetmail.com/

Understand that you will need to get the exchange administrator to give your asp.net machine access to the SMTP port (this usually Port 25) on the exchange server and set up permissions to allow you to relay messages thru the server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!