在实现发送邮件的功能时,我的代码出现报错:

我的实现:
def send_email(self):
# build email message
msg = EmailMessage()
msg['Subject'] = f'Daily Digest - {datetime.date.today().strftime("%d %b %Y")}'
msg['From'] = self.sender_credentials['email']
msg['To'] = ', '.join(self.recipients_list)
# add Plaintext and HTML content
msg_body = self.format_message()
msg.set_content(msg_body['text'])
msg.add_alternative(msg_body['html'], subtype='html')
# secure connection with STMP server and send email
with smtplib.SMTP('smtp-mail.outlook.com', 587) as server:
server.starttls()
server.login(self.sender_credentials['email'],
self.sender_credentials['password'])
server.send_message(msg)
我已经根据https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040 打开了权限,还是出现上图报错。

请问该怎么解决🙂