0 votes

it is not giving bodystructure option
BodyStructure structure = imap.

related to an answer for: How to get body of email
by

1 Answer

0 votes

To obtain BodyStructure from IMAP you need to use Imap.GetBodyStructureByUID method directly:

Imap imap = ...
List<long> uids = imap.GetAll();
List<BodyStructure> structures = imap.GetBodyStructureByUID(uids);

...or you can use Imap.GetMessageInfoByUID to and navigate MessageInfo.BodyStructure property.

Imap imap = ...
List<long> uids = imap.GetAll();
List<MessageInfo> infos = imap.GetMessageInfoByUID(uids);

BodyStructure first = infos.SingleOrDefault().BodyStructure;
by (297k points)
...