Archived Forum Post

Index of archived forum posts

Question:

Download new e-mail

Mar 12 '13 at 22:48

Hello,

Is there any way to download only the new e-mails and not the whole list again and again like Outlook is doing for example?

Thank you, Elad.


Answer

Not sure what OS you are targeting, but have you been to http://www.example-code.com/? Has a lot of examples.


Answer

Thank you for trying to help... I followed the example and could not find any information about this.


Answer

perhaps a combination then.

Determine the Number of Unseen Email Messages

and

Fetch Single Email by UID or Sequence Number

but, selecting the language that you are using. As you have yet to disclose...

In the first example listed there is a line

Set messageSet = imap.Search("UNSEEN",fetchUids)

which appears to return all "unseen" Uid's. (a little background on the search method) And then you should be able to supply that list to the second example.


Answer

I'm trying to help friend, but with vague objectives you only get vague conclusions. One more piece of the puzzle gets you one more shot in the dark.

I've only worked with imap so far so the following is because I went to http://www.example-code.com/vbscript/pop3.asp and after reviewing the options I read Download POP3 Email using UIDLs. Now as I understand it- the basic mechanics of imap and pop3 require fairly different approaches. On a pop3 server the server has no way of determining which emails you have already read if you used a different client... But I'll assume you're intent is to only concern yourself with the emails you have already downloaded with your application (we can't tell if another application downloaded them, unless we can talk to that application...) With this in mind our goal becomes simply recording the UILD's that we download with

    Set email = mailman.FetchEmail(uidl)

which we can stick in an arbitrary table in our db, and the next time we call

Set sa = mailman.GetUidls()

we just skip the emails that we know are already read (by this application...)

I hope that was helpful to your process; if not, please provide a more descriptive request that details your expectations/requirements/prog lang/etc...

As I wrap this up, I took one last look and found the following which explains it much better than I could Reading Unread POP3 Email it's not a perfect solution- but pop3 is far from perfect...