0

I need to get the message id of the email sent with exchangelib. I can't find documentation on how to get it.

item = account.inbox.filter(message_id__in=[message_id]).only( 'subject', 
                                                                'id',
                                                                'message_id',
                                                                'sender',
                                                                'cc_recipients',
                                                                'to_recipients',
                                                                'references')[0]
item.reply(subject='Re: '+ item.subject,
            to_recipients=[item.sender.email_address],
            body='I agree',)

If I get the references item.references I get as a result None

Luis Sucuc
  • 11
  • 3

1 Answers1

0

Sent messages are not stored on the Exchange server unless you send it to a recipient located on the same Exchange server or you explicitly choose to save it to e.g. your sent folder.

To get the message ID, you need to get hold of the Message that was sent. Then you can access the message_id on that item.

Erik Cederstrand
  • 9,643
  • 8
  • 39
  • 63