Not able to read email using python script when i schedule it on windows server 2012 RRS feed

  • Question

  • I can read and send email using my python script when i run it mannually on windows server 2012 r2. I am using mapi. When i schedule it via task scheduler , it is not working on my win server 2012r2  . Is there any service that prevents to run while scheduling . please help me.
    Sunday, December 15, 2019 3:14 PM

All replies

  • it is not working on my win server 2012r2  .

    What error do you get? What statement is failing?

    If you intend to run it unattended via the task scheduler, then you should have proper error handling and logging programmed into your script. Analyze the log to see what calls the script makes and what status codes it encounters. 

    • Edited by MotoX80 Sunday, December 15, 2019 6:03 PM
    Sunday, December 15, 2019 4:13 PM
  • Thanks for your quick response .. I can see script ran successful in Task scheduler . Event id shows 102. But I am not able to read the email from my outlook. On the other hand , when i run the same script manually from the same path, It  is working fine.

    I believe there is some issue with Server side. is there any service that i need to start for accessing outlook from outlook.

    • Edited by Vivekgiri Monday, December 16, 2019 6:10 AM
    Monday, December 16, 2019 6:09 AM
  • Please try to  understand that you are asking questions in the wrong forum. This is not a Python forum and it is not a Task Scheduler forum. YOU will need to learn from Python people how to write Python scripts that can be run under a service. You will need to learn how to use error detection and reporting to use this under a service.

    We cannot teach or help you with Python scripts.  This forum is for Microsoft scripting only.


    Monday, December 16, 2019 6:16 AM
  • Agree !

    I am having issues with Task Scheduler while running a script. If anyone who can help me out here it would be great. :)

    Monday, December 16, 2019 7:31 AM
  • This is not a task scheduler forum. Post task scheduler questions in the Windows General for your version of Windows.


    Monday, December 16, 2019 7:38 AM
  • I am having issues with Task Scheduler while running a script. 

    You are effectively asking us to use our Magic Crystal Ball and tell you what is wrong. It doesn't work that way. Add code to your script to write to a file. Log when the script starts and ends. Put in the Python equivalent of try/catch and write any error codes to the log file.  

    If Python is a command line program you can use this example to capture stdout and stderr.


    Start with the reply that begins "You need to look at what the application is doing". 

    • Edited by MotoX80 Monday, December 16, 2019 1:56 PM
    Monday, December 16, 2019 1:50 PM