I am running the following Python code from jupyter and powershell and it is running flawlessly.
When I put this in window scheduler, it doesn't run. It doesn't show any error either. Could you please help solve the problem? Are there better options to schedule my Python code in window?
I am running python 3.10.
My code was running before:
import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = 'dsrigyan@yahoo.com'
mail.Subject = 'data'
# mail.Body = 'data'
mail.HTMLBody = '''<p style="font-family:Corbel">
Hi Deepa,<br/>
Please find the data for yesterday.<br/>
Let me know if you has any questions.
</p>
<br/><br/><br/><br/>
<p style="font-family:Corbel">
<b>Deepankar Srigyan<br/>
BI & Analytics Manager
</p>
'''
attachment = attachment_file
mail.Attachments.Add(attachment)
mail.Send()