Hi Everybody

Anyone who has gone thru the POP3_IMAP4_Email_Example
given on Nokia forum plz tell us how to know about the no. of deleted mails /whether a mail is deleted or not as we r working on same n we did try Deleted fn with each msg entry to check whether its deleted but even after we delete a msg , TMSvEntry:eleted still returns False flag n we get the same no. of mails as it was b4 deleting the message? Can anybody plz correct us where r we wrong or whats missing.
plz do tell if any of u does know

thks n rgds

here is the code for the fn to get newmail(unread mail) count

// update the remote mail count pop3 version
void CEmailExampleEngine::GetNewMailCountPop3L()
{
TMsvId id=NULL;

iNewMailCount=0;

CMsvEntry* iMailEntry;
TMsvId mailId;

for(TInt i=0; i<iRemoteCount; i++)
{
mailId=(*iRemoteEntries)[i];
iMailEntry=iMsvSession->GetEntryL(mailId);
TMsvEntry& iEntry=iMailEntry->Entry();
if((!iEntry.Deleted()))
{

if(iEntry.Unread())
iNewMailCount++;
}
}
delete iMailEntry;
}


void CEmailExampleEngine::HandleSessionEventL(TMsvSessionEvent aEvent,TAny* /*aArg1*/,TAny* /*aArg2*/,TAny* /*aArg3*/ )
{

//****************//
iEventCount++;

TBuf<256> buffErr;
TBuf<256> msg;

msg.Num(iAutoPop3);
//User::InfoPrint(msg);

if(iAutoPop3==2)
buffUse.Copy(_L("Using Default"));
else
buffUse.Copy(_L("Using UniMsg"));

User::InfoPrint(buffUse);

switch (aEvent)
{
case MMsvSessionObserver::EMsvEntriesCreated:
msg.Copy(_L("One or more entries\n have been created."));
break;


case MMsvSessionObserver::EMsvEntriesChanged:
msg.Copy(_L("One or more index\n entries have been changed. "));
break;



case MMsvSessionObserver::EMsvEntriesDeleted:
msg.Copy(_L("One or more entries\n have been deleted."));
break;


case MMsvSessionObserver::EMsvEntriesMoved:
msg.Copy(_L("One or more entries\n have been moved."));
break;


case MMsvSessionObserver::EMsvMtmGroupInstalled:
msg.Copy(_L("A new MTM has\n been installed. "));
break;



case MMsvSessionObserver::EMsvMtmGroupDeInstalled:
msg.Copy(_L("A MTM has\n been uninstalled. "));
break;

/*
case MMsvSessionObserver::EMsvStoreDeleted:
msg.Copy(_L("A CMsvStore has been deleted. "));
break;



case MMsvSessionObserver::EMsvStoreCommitted :
msg.Copy(_L("A CMsvStore has been committed."));
break;
*/

case MMsvSessionObserver::EMsvGeneralError :
msg.Copy(_L("Something has happening\n in the server, but this \nclient was unable to \nretrieve the information."));
break;

/*
case MMsvSessionObserver::EMsvStoreCreated :
msg.Copy(_L("An entry has just created a store. "));
break;
*/

case MMsvSessionObserver::EMsvCloseSession :
msg.Copy(_L("The client should \nimmediately close the \nsession with the Message\n Server."));
break;


case MMsvSessionObserver::EMsvServerReady :
msg.Copy(_L("Received after a \nclient has used\n CMsvSession::OpenAsyncL() \nto create a session. "));
break;



case MMsvSessionObserver::EMsvServerFailedToStart :
msg.Copy(_L("Received after a \nclient has used CMsvSession::OpenAsyncL()\n to create a session. "));
break;



case MMsvSessionObserver::EMsvCorruptedIndexRebuilt :
msg.Copy(_L("The Message Server\n index had been corrupted and\n had to be rebuilt. "));
break;


case MMsvSessionObserver::EMsvServerTerminated :
msg.Copy(_L("The Message Server\n has been terminated. "));
break;


case MMsvSessionObserver::EMsvMediaChanged :
msg.Copy(_L("The Message Server\n has automatically changed the\n index location to\n use the internal disk."));
break;


case MMsvSessionObserver::EMsvMediaUnavailable :
msg.Copy(_L("The media (disk) \ncontaining the Message Server\n index has been removed. "));
break;


case MMsvSessionObserver::EMsvMediaAvailable :
msg.Copy(_L("The disk containing\n the Message Store is \navailable again."));
break;


case MMsvSessionObserver::EMsvMediaIncorrect :
msg.Copy(_L("An incorrect disk \nis inserted. "));
break;


case MMsvSessionObserver::EMsvCorruptedIndexRebuilding :
msg.Copy(_L("The Message Server \nhas started to rebuild \nits index after it\n has been corrupted."));
break;
}

//buffErr.Format(_L("Event:%d"),aEvent);
//User::InfoPrint(buffErr);
//buffErr.Format(_L("Event:%d\nMsg:%S"),aEvent,&msg);
//CGeneralClass::PopUpError(buffErr);
//****************//

switch(aEvent)
{
// the messaging server is ready
case MMsvSessionObserver::EMsvServerReady:
{
if(iState==EInitialising)
{
TRAPD(err,UpdateRemoteCountL());
if(err==KErrNone)
{
iState=EReady;
}
else
{
iState=EReadyButNeedsUpdating;
}
}
}
break;

case MMsvSessionObserver::EMsvEntriesCreated:
case MMsvSessionObserver::EMsvEntriesChanged:
case MMsvSessionObserver::EMsvEntriesDeleted:
case MMsvSessionObserver::EMsvEntriesMoved:
UpdateRemoteCountL();
GetNewMailCountPop3L();
break;
case MMsvSessionObserver::EMsvMtmGroupInstalled:
case MMsvSessionObserver::EMsvMtmGroupDeInstalled:
case MMsvSessionObserver::EMsvGeneralError:
case MMsvSessionObserver::EMsvCloseSession:
case MMsvSessionObserver::EMsvServerFailedToStart:
case MMsvSessionObserver::EMsvCorruptedIndexRebuilt:
case MMsvSessionObserver::EMsvServerTerminated:
case MMsvSessionObserver::EMsvMediaChanged:
case MMsvSessionObserver::EMsvMediaUnavailable:
case MMsvSessionObserver::EMsvMediaAvailable:
case MMsvSessionObserver::EMsvMediaIncorrect:
case MMsvSessionObserver::EMsvCorruptedIndexRebuilding:
break;
}
}

void CEmailExampleEngine::SetProtocolType( TInt aProtocolType )
{
iProtocolType = aProtocolType;
}