I understood that we can read emails from outlook using the following code(Reading e-mails from Outlook with Python through MAPI).
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6) # "6" refers to the index of a folder - in this case,
# the inbox. You can change that number to reference
# any other folder
messages = inbox.Items
message = messages.GetLast()
body_content = message.body
print body_content
But we are not providing username and password anywhere in the above code. Then How did the code authenticate the outlook account.
Can any one explain how the authentication is happening here.