Hello, there are several ways to retrieve the list of recipients. For example:
a) Retrieve message info (ImapMessageInfo
object) using GetMessageInfo method. Use ImapMessageInfo
properties such as To
or CC
to get a list of recipients.
b) Download the message into MailMessage
object using GetMailMessage method. Use MailMessage
properties such as To
or CC
to get a list of recipients.
In both cases, the To
and CC
properties return an instance of MailAddressCollection that can easily be iterated.
The properties of MailMessage
can be modified, but please be aware that this won't change the message at the IMAP server.
Unfortunately, the IMAP protocol doesn't make it possible to modify a message at the server, so if you would like to achieve something like that, you have to download the message, modify it, upload it again (it will get a different ID) and delete the original one.