none
Reading emails in outlook periodically by configuring a console application EXE using Windows Task Scheduler. RRS feed

  • Question

  • Hi Team,

    We have a requirement where in we need to read the mails from MS-Outlook installed on the production server and configured for a specified account for every 10 mts.

    To acheive the same we have developed a console application,referred Microsoft Interop assemblies,using Mapi we are connecting to the outlook and reading all the UNREAD emails and downloading the attachments from them and placing it to the idetified location.We completed this and  tested it on our local and Test environments and it worked fine with out any issues.

    Issue is coming up when the EXE is configured using Windows Task Scheduler to run for every 10 mts.For configuring the EXE,we have used the account which is a member of local Admin group of that respective environment.Once we configured the EXE,it is being executed for some time and after that it is getting failed fo a huge time.

    When we restart the server,it is again started working.This is happening very frequently.We could not able to understand the reason for this issue.

    Can some one please help us.

    Thanks in Advance.

    • Moved by Paul Zhou Tuesday, January 3, 2012 6:13 AM move for better support (From:.NET Base Class Library)
    Monday, January 2, 2012 4:15 AM

Answers

  • Office automation in an unattended scenario (such as your task scheduler) isn't officially supported by Microsoft. It usually works, but there are known stability issues, especially if modal dialogs block the UI or  when you're trying to access methods which have been restricted in later versions of Outlook.

    You might want to check out Exchange Web Services or (if you're using an older version of Exchange) use Exchange WebDAV. These web service API's allow you to connect directly to the Exchange server and you can manipulate the messages directly without having to have Outlook running in the background.

    If you're reading mail from a IMAP/POP3 server, then try using a respective library to connect to the server directly.


    My blog: blog.jessehouwing.nl
    • Proposed as answer by Bruce Song Thursday, January 12, 2012 6:16 AM
    • Marked as answer by Bruce Song Wednesday, January 18, 2012 4:47 AM
    Sunday, January 8, 2012 3:32 PM

All replies

  • Hi Moss,

    Welcome to the MSDN forum.

    I'm moving this thread to Outlook for Developers forum to get better support.

    Moreover, could you please post your code that helps us to reproduce this issue. Any more information that helps us to understand it would be appreciated.

    Thanks.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, January 3, 2012 6:11 AM
  • Hi Moss,

    How about the problem on your side? Could you make sure the outlook application is correctly closed. I recommend you provide more logs, or design the log system for the product. If you still show any concern on the problem, just feel free to let us know.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, January 4, 2012 5:13 AM
  • Office automation in an unattended scenario (such as your task scheduler) isn't officially supported by Microsoft. It usually works, but there are known stability issues, especially if modal dialogs block the UI or  when you're trying to access methods which have been restricted in later versions of Outlook.

    You might want to check out Exchange Web Services or (if you're using an older version of Exchange) use Exchange WebDAV. These web service API's allow you to connect directly to the Exchange server and you can manipulate the messages directly without having to have Outlook running in the background.

    If you're reading mail from a IMAP/POP3 server, then try using a respective library to connect to the server directly.


    My blog: blog.jessehouwing.nl
    • Proposed as answer by Bruce Song Thursday, January 12, 2012 6:16 AM
    • Marked as answer by Bruce Song Wednesday, January 18, 2012 4:47 AM
    Sunday, January 8, 2012 3:32 PM
  • Hi Moss,
    How about the problem on your side? Do you still need any assistant about the problem? If you still show any concern on the problem, just feel free to let us know.
    Best Regards,
    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, January 11, 2012 4:40 AM