0

i am trying to setup my window service on windows 2019 server with outlook 365 and getting below error. same code is running fine on windows server 2012 with outlook 365.Window service and outlook running on same service account which has admin access on server.

Error in Email Download service: Error in IMAPISession::OpenMsgStore: MAPI_E_FAILONEPROVIDER ulVersion: 0 Error: Microsoft Exchange is not available. Either there are network problems or the Exchange server is down for maintenance. Component: Microsoft Exchange Information Store

Code we are using:

#region Mail Box Login ` //Creating new Redemption Mail Session. RDOSession objMailSession = new RDOSession(); CMTrace.WriteLine("Initiated new Redemption mail session");

            //Setting default folder.
            rdoDefaultFolders objInboxFolder = rdoDefaultFolders.olFolderInbox;
            CMTrace.WriteLine("Initializing the default folder of Outlook as Inbox");

            //Login to Exchange Mail Box.
            objMailSession.Logon("", "", false, false, null, false);
            CMTrace.WriteLine("Logged in to Outlook Exchange Mail Box successfully");

            //Set Email Inbox as Default Folder.
           ** RDOFolder objFolder = objMailSession.GetDefaultFolder(objInboxFolder);
            CMTrace.WriteLine("Inbox set as Default Folder.");**

` the last line giving error while trying to setup inbox as default folder.

trying to read emails from outlook 365

0 Answers0