Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Gmail, how to set email as unread Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
namtuk
Newbie
Newbie


Joined: 18 December 2006
Location: France
Online Status: Offline
Posts: 35
Posted: 07 March 2017 at 2:49am | IP Logged Quote namtuk

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 View namtuk's Profile Search for other posts by namtuk
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 07 March 2017 at 2:53am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
namtuk
Newbie
Newbie


Joined: 18 December 2006
Location: France
Online Status: Offline
Posts: 35
Posted: 07 March 2017 at 3:03am | IP Logged Quote namtuk

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 View namtuk's Profile Search for other posts by namtuk
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 07 March 2017 at 3:52am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
namtuk
Newbie
Newbie


Joined: 18 December 2006
Location: France
Online Status: Offline
Posts: 35
Posted: 07 March 2017 at 5:32am | IP Logged Quote namtuk

Thank you for your sample, yes it works with it, i need to find why it doesn't in my side ;)
Back to Top View namtuk's Profile Search for other posts by namtuk
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide