【发布时间】:2018-03-18 03:31:15
【问题描述】:
我知道我们可以使用以下代码(Reading e-mails from Outlook with Python through MAPI)从 Outlook 中读取电子邮件。
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
但我们没有在上述代码的任何地方提供用户名和密码。 那么代码是如何验证outlook账号的呢。
任何人都可以在这里解释身份验证是如何发生的吗?
【问题讨论】:
标签: python email outlook win32com