Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET IMAP

 AfterLogic Forum : MailBee.NET IMAP
Subject Topic: DownloadEntireMessage w/out marking read Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 03 February 2017 at 12:29am | IP Logged Quote hmuscroft

I've noticed that when I call "DownloadEntireMessage" it also seems to mark the email as READ.

Is this by design in MAILBEE (in which case, is there a way of getting the message without marking as read) or is this something that the IMAP server is doing?

My app needs to be able to download and preview an email, without marking it as read.

Many thanks!
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 03 February 2017 at 12:31am | IP Logged Quote hmuscroft

Ignore that - I just found the 'SetSeenForEntireMessages' property.

http://afterlogic.com/mailbee-net/docs/MailBee.ImapMail.Imap.SetSeenForEntireMessages.html
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 06 February 2017 at 1:48am | IP Logged Quote hmuscroft

Further to this question, I sometimes need to get both the MailMessage object AND the Envelope too.

I was using the following :-
Code:
Envelope.env = m_imap.DownloadEnvelopes(UIDs, true, EnvelopeParts.All, -1, null, null);


This gets both the envelope and the entire MailMessage (which is stored in the env.MessagePreview property).

The problem is that this call also marks the email as '\SEEN' on the IMAP server.

Is there a way of downloading both the envelope and the message in one call (like this) but without marking it as READ?

I can work-around this by calling "DownloadEnvelopes" to get just the flags, and then calling "DownloadEntireMessage" separately with "SetSeenForEntireMessages" as FALSE, but I was wondering if there's a better way?

Thanks.
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 06 February 2017 at 1:52am | IP Logged Quote Igor

Hello,

According to DownloadEnvelopes Method documentation page, setting message preview size to -2 will ensure message isn't marked as read:

Code:
Envelope.env = m_imap.DownloadEnvelopes(UIDs, true, EnvelopeParts.All, -2, null, null);


Hope this helps.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 06 February 2017 at 3:31am | IP Logged Quote hmuscroft

Oops - I didn't spot the magic value in the documentation - thanks for pointing it out!
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 

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