0 votes

When calling GetMessageInfo(uid) the Flags collection is not populated, requiring me to call GetFlags(uid). This call is very expensive, consuming a significant amount of time and data transfer. Is there a better way to see the seen status of a message?

by (200 points)

1 Answer

0 votes

Imap.GetMessageInfoByUID retrieves several IMAP parameters including flags.

Those parameters are as follows: RFC822.SIZE, INTERNALDATE, FLAGS, ENVELOPE, BODYSTRUCTURE and in case of Gmail: X-GM-THRID, X-GM-MSGID, X-GM-LABELS.

To diagnose this further, please turn on logging:

If the flags are not in the server response there is nothing you can do - you must use GetFlagsByUID(List uids). Make sure you are using the overload with uid list as argument. Retrieving data in bulk is generally much faster, then invoking this method for every uid.

by (298k points)
edited by