class MAPIEx
MAPIEx base class.
MAPIEx()
Default constructor.
bool Login(const String szProfileName = NULL, DWORD dwFlags = 0, bool bInitAsService = false)
MAPI login function.
To change default parameters check its use here.
String GetProfileName()
Gets the Outlook profile name.
String GetProfileEmail()
Gets the email of the actual Outlook profile.
bool OpenMessageStore(int nIndex, ULONG ulFlags=MAPI_MODIFY | MAPI_NO_CACHE)
Opens nIndex message store with flags ulFlags.
bool OpenMessageStore(String szStore=NULL, ULONG ulFlags=MAPI_MODIFY | MAPI_NO_CACHE)
Opens message store with name szStore with flags ulFlags.
int GetMessageStoreCount()
Gets the messages number of opened message store.
bool GetMessageStoreProperties(int nIndex, String& strName, bool& bDefaultStore)
Gets the properties of nIndex message store like its name in strName and if it is the default store in bDefaultStore.
bool OpenFolder(const String &folderName, MAPIFolder &folder)
Sets in folder the folder with name folderName.
bool OpenRootFolder(MAPIFolder &folder)
Sets in folder the root folder of the folder tree.
bool OpenInbox(MAPIFolder &folder)
Sets in folder the Inbox folder.
bool OpenOutbox(MAPIFolder &folder)
Sets in folder the Outbox folder.
bool OpenSentItems(MAPIFolder &folder)
Sets in folder the Sent Items folder.
bool OpenDeletedItems(MAPIFolder &folder)
Sets in folder the Deleted Items folder.
bool OpenContacts(MAPIFolder &folder)
Sets in folder the Contacts.
bool OpenDrafts(MAPIFolder &folder)
Sets in folder the Drafts folder.
bool OpenCalendar(MAPIFolder &folder)
Sets in folder the Calendar.
bool Notify(LPNOTIFCALLBACK OnNewEvent, LPVOID lpvContext, ULONG ulEventMask)
Sets a function as a callback to receive Outlook events.
This function has to be declared:
long CALLBACK OnNewEvent(LPVOID lpvContext, ULONG cNotification, LPNOTIFICATION lpNotifications)
When an event occurs in Outlook the OnNewEvent function is called with the pointer included in lpvContext. cNotification will include the reason of the event.
The possible sources of this callback are included in ulEventMask mask. Some sources are:
fnevNewMail
fnevObjectCreated
fnevObjectDeleted
fnevObjectModified
fnevObjectMoved
fnevObjectCopied
fnevSearchComplete
Remember that a new mail event will probably arrive a little while after the message arrives depending on your Exchange Server's setup.
The callback is called once per event (if four emails are deleted at the same time, four events will be received.
bool SelectContacts(Vector<String> &emails, const String caption)
Shows a window to choose emails from Contacts. All selected emails will be returned in emails Vector. The window title is in caption.
|