All,
I have the following code :
void Test()
{
DropDirectory DropDir=new DropDirectoryClass();
IMessages Messages= DropDir.GetMessages(null);
foreach (IMessage Message in Messages)
{
System.Diagnostics.Debug.WriteLine(Message.From); /// POS 1
}
Messages.DeleteAll(); //// FILES IN THE DROP FOLDER STAY, THEY SHOULD BE
DELETED.
}
in main
Test(); // WORKS FINE
Test(); // THROWS ERROR AT POS 1
The deleteall does not delete the files until the program exits, it just
marks the files as deleted and they cannot be accessed again, this means
when the code run again to process more emails it picks the files up again
but fails to access the Message.From.
I have seen someone on DEJA with the same problem but when using JAVA, there
was no workable solutions, only one answer that used MAPI and C++
Cheers
Steve
|