我想知道是否有办法关闭与exchangelib的连接。
这是我的设置和连接功能;我需要定义一个close_conection()
函数,但没有找到任何阅读文档的内容。
class Exchange:
def __init__(self, username, password, server):
""""""
self.username = username
self.password = password
self.server = server
def account(self):
"""Setup and connecting"""
creds = Credentials(
username=self.username,
password=self.password
)
config = Configuration(server=self.server, credentials=creds)
account = Account(
primary_smtp_address=self.username,
autodiscover=False,
config=config,
access_type=DELEGATE
)
return account