IDropDirectory Interface

IDropDirectory Interface

The IDropDirectory interface defines an abstract method that you can use to access a collection of messages that reside either in the Simple Mail Transfer Protocol (SMTP) default drop directory or in some other specified file system directory.

  • IID
    CD000024-8B95-11D1-82DB-00C04FB1625D
  • Extends
    IDispatch

Member Summary

Method

Name Description

GetMessages

Returns a collection containing the messages in the specified directory.

Remarks

Component Object Model (COM) objects expose the IDropDirectory interface to provide access to a collection of messages stored on the file system. The GetMessages method returns a collection object exposing the IMessages interface. Each object in the collection is an instance of the Message COM class and contains the complete message stored in the file. If no file system path is specified, the SMTP service default drop directory is used. The default drop directory is where newly arrived messages are stored for local users.

Microsoft® Windows® 2000 does not provide direct mailbox support. Instead, incoming mail messages are delivered to a physical disk directory called a drop directory and placed in files with the .eml extension. Outgoing messages that you send are placed in another disk directory called a pickup directory. When you install and configure the Windows 2000 Server, the SMTP service determines path and file names for the drop and pickup directories. These directories are initialized and maintained by the service, and are the default locations for incoming and outgoing messages.

Example

' Reference to Microsoft ActiveX Data Objects 2.5 Library
' Reference to Microsoft CDO for Windows 2000 Library
Dim iDropDir as New CDO.DropDirectory
Dim iMsgs as CDO.IMessages
Set iMsgs = iDropDir.GetMessages("c:\Inetput\mailroot\Drop")
' you now have the collection of messages
' in the SMTP drop directory
...
Set iMsgs = iDropDir.GetMessages("c:\mymessages")
' you now have the collection of messages
' located in the directory c:\mymessages
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace raw_interfaces_only
#import "c:\winnt\system32\cdosys.dll" no_namespace raw_interfaces_only
main() {
   CoInitialize(NULL);

   IDropDirectory* pDropDir = NULL;
   IMessages*      pMsgs    = NULL;
   CoCreateInstance(
      __uuidof(DropDirectory),
      NULL,
      CLSCTX_INPROC_SERVER,
      __uuidof(IDropDirectory),
      (void**)pDropDir
   );

    // get collection from SMTP drop directory
    pDropDir->GetMessages(L"c:\\Inetput\\mailroot\\Drop",&pMsgs);
    pMsgs->Release();
    // get collection from specific directory
    pDropDir->GetMessages(L"c:\\mymessages",&pMsgs);
    pMsgs->Release();
    pDropDir->Release();
    CoUninitialize();
}
Dim iDropDir
Set iDropDir = CreateObject("CDO.Configuration")
Dim iMsgs
Set iMsgs = iDropDir.GetMessages("c:\Inetpub\mailroot\Drop")
' you now have the collection of messages
' in the SMTP drop directory
...
Set iMsgs = iDropDir.GetMessages("c:\mymessages")
' you now have the collection of messages
' located in the directory c:\mymessages