To create a mailbox for a recipient, create the object for that recipient in the directory. Later, the information store automatically creates a mailbox the first time a person or an application logs on as this recipient (after a MAPI profile has been created) or when someone tries to send mail to the recipient. No separate action is needed to create the object in the information store.
Create a mailbox object in the directory by calling the DAPIWrite function. You can also use this call to DAPIWrite to create a Windows NT user account. In this function call, pass the pAttributes parameter, which points to a DAPI_ENTRY structure containing names of attributes to write. In this DAPI_ENTRY structure, you need to specify, at minimum, the following attributes:
A specific server.
— Or—
The string ~SERVER, which will be replaced with the name of the bound server.
Although other attributes are required, default values are assigned if you omit them. For example: