我尝试使用 Chilkat 包在 Spyder(Python 3.6)中使用 IMAP 连接到 Gmail 服务器。我在“设置”>“转发”和“POP/IMAP”中为所有邮件启用了 IMAP ,然后我还在此处启用了不太安全的应用程序选项卡https://myaccount.google.com/lesssecureapps?pli=1登录后。但在这段代码
import sys
import chilkat
imap = chilkat.CkImap()
# Anything unlocks the component and begins a fully-functional 30-day trial.
success = imap.UnlockComponent("Anything for 30-day trial")
if (success != True):
print(imap.lastErrorText())
sys.exit()
# Connect to an IMAP server.
# Use TLS
imap.put_Ssl(True)
imap.put_Port(993)
success = imap.Connect("imap.gmail.com")
为 a的success
变量boolean
仍然为 False。请帮我。我的目标是从 Outlook Server 获取所有附件并将它们转储到一个文件中。但我什至无法连接到 Gmail 服务器。我尝试使用“imap.mail.Outlook.com”,但也失败了。我不知道在 Outlook 中启用 IMAP 的步骤。但是即使在 Gmail 中启用了它,为什么它不起作用?