For years now we've been sending emails care of Don Dickinsons MAPI code, copy of which you can see here: http://www.greatwebdivide.com/files/pb_map2.bas.

This worked great on everything up to XP but now I've found programs hanging when running on Vista - Home Premium specifically but possibly all versions of Vista. The code gets to the smapiLogon function and then hangs at the line:

Code:
Call Dword ptrMAPILogon Using mapiTemplate_MAPILogon( 0, zAccount, zPW, %MAPI_LOGON_UI, 0, hSession )
needing to be stopped through the Task Manager. GetProcAddress(gMAPILib, "MAPILogon") has worked ok and returned a value to ptrMAPILogon.

Anyone any ideas why this might be happening? Tested on several Vista boxes with the same result.

Thanks

Nick