简体   繁体   中英

How can I set a message unread?? with delphi 7 and imap from indy10

How can I set a email message unread??

Here I read the emails from inbox in gmail

When I read gmail, it flag like read, so I would like to flag like unread again.

 TheImap.GetUID(i+1, TheUID);
 TheImap.UIDRetrieveFlags(TheUID, TheFlags);
 TheImap.UIDRetrieveHeader(TheUID, TheMsg);
 TheImap.UIDRetrieveText(TheUID, lacadena);

 if mfSeen in TheFlags then begin
   TheImap.StoreFlags(TheUID, sdReplace, TheMsg.Flags - [mfSeen] );

You are trying to pass a UID string where a MsgNum integer is expected. You need to use UIDStoreFlags() instead of StoreFlags() :

TheImap.UIDStoreFlags(TheUID, sdReplace, TheFlags - [mfSeen]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM