Product SiteDocumentation Site

Chapter 3. Conventions

3.1. Objects
3.2. Modules
3.2.1. MAPI.Struct
3.2.2. MAPI.Time
3.2.3. MAPI.Tags
3.2.4. MAPI.Defs
3.2.5. MAPI.Util
3.3. Parameters
3.4. Errors
3.5. Flags
3.6. Methods
3.7. Character sets and Unicode
3.8. Memory management

3.1. Objects

There is a one-to-one relationship between objects in MAPI and the objects presented to Python. MAPI provides two main entrypoints in a classfactory-pattern to obtain references to the top-level objects.
These functions are:
MAPIAdminProfiles()
MAPILogonEx()
These functions can be used to create and manage MAPI profiles, and log on to one of those profiles, respectively. Each call returns a top-level object which can be used to subsequently open other objects:
import MAPI

profadmin = MAPI.MAPIAdminProfiles(0)
profadmin.CreateProfile('profile','password', 0, 0)

...

session = MAPI.MAPILogonEx(0, 'profile','password', 0)
session.GetMsgStoresTable(0)