I want to download an excel attachment from MS Outlook Web App - https://webmail.xyz123.com.sg/owa/auth/logon.aspx?
I have a generic email ID to which my users will be sending source data in an excel format. I want to fetch that attachment with a particular subject and load that in my SQL server.
- I cannot access this email ID from outlook desktop app as it is a generic email ID.
- I don't have SMTP server details.
- I do have credentials for this email ID
I tried some of the codes like below but all of them are trying to access Inbox folder (folder index = 6 ) to access emails, in my case that is not possible as I don't have this email ID's setup in desktop app.
from win32com.client import Dispatch
import datetime as date
outlook = Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder("6")
all_inbox = inbox.Items
val_date = date.date.today()
I expect the output to be -
- Access my generic email ID from Outlook web app
- Download the excel attachment.