Я использую пакет exchangelib для подключения к Exchange.Мне нужно отправить вложения в ответ.Когда я отправляю обычное сообщение, я добавляю вложение к объекту Message следующим образом:
message = Message()
message.account = account
message.subject = 'subject'
message.body = 'text'
message.to_recipients = [Mailbox(email_address='example@gmail.com')]
message.cc_recipients = ['example2@gmail.com']
for attachment in attachments or []:
with open(attachment['path'], 'rb') as f:
file = FileAttachment(name=attachment['file_name'], content=f.read())
message.attach(file)
и отправляю ответ:
reply = message.reply(
subject='Re: subject',
body='texto',
to_recipients=['example@gmail.com']
)
Это работает, но сейчас неткак добавить вложения в ответ.Я пытался установить атрибуты "attachments" и "attach", но у объекта их нет.