If you are running the x64 build and trying to send MAPI mail from a 32-bit mail program (like Outlook), you'll probably find that the MAPI Logon / Logoff calls in
CMailMsg::Send()fail If so, just #ifdef out those calls for your x64 build because the MAPISendMail call will still work fine. e.g.
LHANDLE hMapiSession = 0;
#if defined (_M_X64)
#else
status = m_lpMapiLogon(NULL, NULL, NULL, MAPI_LOGON_UI|MAPI_PASSWORD_UI, NULL, &hMapiSession);
if (status != SUCCESS_SUCCESS)
{
m_sErrorMsg.Format(_T("MAPILogon has failed with code %X."), status);
return FALSE;
}
#endif
...
if (hMapiSession != 0)
{
m_lpMapiLogoff(hMapiSession, NULL, 0, 0);
}