Casey Harris - 2010-11-10

Hello all,

I would like to access the emails on a server using an index. When using vmime, are items fetched using the email server index or a type of count:

Example:

My thoughts are that emails exist on the server in the following way:

Index                                       Subject                                           Attachments
123 Oct 10 2:00PM         Come to my party
124 Oct 10 8:49PM         Getting ready to leave          mypic1.jpg mypic2.jpg
125 Oct 10 10:00PM Here at the party
126 Oct 10 10:30PM Drinking some beers
127 Oct 11 01:21AM         Drank too much leaving now whoimet1.jpg whoimet2.jpg
128 Oct 11 02:00AM         At home now                 partypic1.jpg partypic2.jpg
129 Oct 11 08:00AM  Going to work         mycar.jpg
130 Oct 11 09:00AM          At the office                 mycubemate.jpg

So,

If I use:
vmime::datetime start(StartYear, StartMonth, StartDay,  StartHour, StartMin,  StartSec);
vmime::datetime end( EndYear, EndMonth, EndDay,EndHour, EndMin,EndSec);

vector <vmime::ref<vmime::message> > messages = importConnection->getMessages(start, end);

Where "Start" and "end" are associated with "Oct 10 10:25PM" and "Oct 11 2:20AM" respectively, then the
result will be:
126 Oct 10 10:30PM Drinking some beers
127 Oct 11 01:21AM  Drank too much leaving now whoimet1.jpg whoimet2.jpg
128 Oct 11 02:00AM         At home now                 partypic1.jpg partypic2.jpg

How would I get email #127 for processing?

Should I use: vmime::ref<vmime::net::message> orgMsg = folder->getMessage(127);

Or, should one use:

vmime::datetime start(StartYear, StartMonth, StartDay,  StartHour, StartMin,  StartSec);
vmime::datetime end( EndYear, EndMonth, EndDay,EndHour, EndMin,EndSec);

and then use

Should I use: vmime::ref<vmime::net::message> orgMsg = folder->getMessage(1);

When getting emails from the server, do you use 0,1,2 to get the message or the index in the email server itself
(i.e. 126, 127, 128).

Regards.