Send an email using exchange server ONLY

人走茶凉 提交于 2021-01-27 22:42:51

问题


I need to send an email in my C# project using my companies Exchange Server.

Because someone sent out thousands of Emails from my company using a self hosted server, any attempts to not use the company Exchange Server to send the email will be squished.

I imagine I am going to need to get an Active Directory user created to do this... but what code to use? How to do the sending?


回答1:


You can send email through Exchange using SMTP with .Net's SmtpClient class.
You will need a login for the server.




回答2:


You could use the System.Net.Mail classes to send the email via SMTP if that is enabled on your SMTP server. Alternatively you could use the webdav protocol to send the email via HttpRequests and HttpResponses. An example showing how to do this can be found here.



来源:https://stackoverflow.com/questions/5173530/send-an-email-using-exchange-server-only

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