Author |
|
namtuk Newbie
Joined: 18 December 2006 Location: France
Online Status: Offline Posts: 35
|
Posted: 07 March 2017 at 2:49am | IP Logged
|
|
|
Dear,
I'm trying to force to set email as unread in Gmail (IMAP4), i tried to use SetSeenForEntireMessages and SetMessageFlags(index, false, systemMessageFlags.Seen, MessageFlagAction.Add), but it doesn't work with Gmail, it is working fine with a regular IMAP4 server.
Any idea?
Regards
Jean-claude
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 07 March 2017 at 2:53am | IP Logged
|
|
|
Quote:
i tried to use SetSeenForEntireMessages and SetMessageFlags(index, false, systemMessageFlags.Seen, MessageFlagAction.Add) |
|
|
That would mark messages as read, while you intend to mark those as unread, so the Seen flag needs to be removed rather than added - or do I misunderstand something here?
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
namtuk Newbie
Joined: 18 December 2006 Location: France
Online Status: Offline Posts: 35
|
Posted: 07 March 2017 at 3:03am | IP Logged
|
|
|
Sorry, yes it is remove in the code... and with remove it doesn't work on Gmail but work on regular IMAP4 server...
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 07 March 2017 at 3:52am | IP Logged
|
|
|
I've just tested the following code with my Gmail account:
Code:
Imap imp = new Imap();
imp.Connect("imap.gmail.com", 993);
imp.Login("my-username@gmail.com", "my-password");
imp.SelectFolder("INBOX");
imp.SetMessageFlags(imp.MessageCount.ToString(), false, SystemMessageFlags.Seen, MessageFlagAction.Remove);
imp.Close(); |
|
|
Upon running the code and refreshing the Inbox, I saw that the newest message became unread there. Can you try the above example and see if it works?
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
namtuk Newbie
Joined: 18 December 2006 Location: France
Online Status: Offline Posts: 35
|
Posted: 07 March 2017 at 5:32am | IP Logged
|
|
|
Thank you for your sample, yes it works with it, i need to find why it doesn't in my side ;)
|
Back to Top |
|
|