1

I think I'm stuck looking for an efficient solution

 print(item.cc_recipients)

I got the result:

[Mailbox(name='xxx1@gmail.com', email_address='xxx1@gmail.com', routing_type='SMTP', mailbox_type='OneOff', item_id=None), Mailbox(name='xxxx xxxx', email_address='xxx.xxx@xx.xx.com', routing_type='SMTP', mailbox_type='Mailbox', item_id=None)]

but I would like to download a list with just email addresses ?, Is there a quick solution?

aliciavika
  • 87
  • 8

1 Answers1

1

item.cc_recipients returns a list of Mailbox items. A Mailbox item has an email_address attribute. To convert cc_recipients to a list of email addresses, do:

print([m.email_address for m in item.cc_recipients])
Erik Cederstrand
  • 9,643
  • 8
  • 39
  • 63