FYI: MAPI Application does not work when running from Windows Service (MAPI_E_NETWORK_ERROR)
I recently had two cases where the MAPI application was failing while creating a dynamic profile calling IMsgServiceAdmin::ConfigureMsgService.
Although if the same application is executed outside Service Control Manager then it work and is able to create the profile just fine.
In both cases we found out that the older versions of OLMAPI32 had this problem and you MUST upgrade to the latest version 12.0.6514.5000 or above
Publically available latest version is “October 2009 security update” - http://support.microsoft.com/kb/972363