Steiner,

To send the mail immediately, you could add another modified MAPILogon after your MAPILogoff.

[vba]

'your existing code
'.
'.
lRet = MAPILogoff(lSess, 0, 0, 0)

'Then logon again using the MAPI_FORCE_DOWNLOAD flag
MAPILogon(0, "", "", MAPI_LOGON_UI + MAPI_FORCE_DOWNLOAD, 0, lSess)
lRet = MAPILogoff(lSess, 0, 0, 0)
[/vba]


Setting the MAPI_FORCE_DOWNLOAD bit forces a send/receive of messages to/from the server.

Too bad this flag isn't available in the MAPILogoff function

Cheers,
James