IDropDirectory Interface

Topic Last Modified: 2006-06-13

Defines an abstract method used to access a collection of messages that reside either in the SMTP default drop directory or in some other specified file system directory.

Because IDropDirectory is only used for accessing messages on a file system, it is not useful in CDO for Exchange 2000 Server (CDOEX) where messages are saved in the Exchange store.

CLSID

CD000024-8B95-11D1-82DB-00C04FB1625D

Extends

IDispatch

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Member Summary

The following table lists the methods of the IDropDirectory interface.

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 are placed in another disk directory called a pickup directory. When you install and configure Microsoft® 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 inbound and outgoing messages.

Examples

[Visual Basic]

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

[C++,IDL]

#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();
}

[VBScript]

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