简体   繁体   中英

Sending e-mail via MS Exchange from a batch process

I have a C# program which will be scheduled to run weekly on a Windows 2008 server. It will be executed under a service account (domain, not local). I want this program to send e-mails via our MS Exchange server.

What needs to be done on the Exchange side so that this service account can access Exchange (preferrably via EWS) and send e-mails?
We already have a shared mailbox which I would like to use for sending e-mails - ie the e-mails would have "from" address of that shared mailbox. It would be great if we could avoid creating another mailbox for the service account.

Any other ideas on how to send e-mails? I can't install any 3rd party programs on the server.

**If you already have shared mailbox created ,u can use the credentials of that mailbox for sending an email using EWS and the "From" address will be that of the shared mailbox.There is no need to create a mailbox for the service account that's used to run your batchjob. Here's a link which gives a code sample on how to send an email using EWS.

http://chrisbitting.com/2013/02/21/retrieving-and-sending-email-using-exchange-web-services-managed-api-2-0-c/

While specifying the credentials,give that of the shared mailbox and u are good to go.**

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM