Anonymous
Гость
|
|
« Ответ #1 : Апрель 13, 2004, 01:32 » |
|
vot primer is s pom. mapi.dll
void OnSend() { MapiRecipDesc desc = {0}; MapiMessage msg = {0};
desc.lpszAddress = "SMTP:lepsai@mail.ru"; desc.lpszName = "lepsai"; desc.ulRecipClass = MAPI_TO;
msg.lpszSubject = "your subject"; msg.lpszNoteText = const_cast<char *>( (LPCTSTR)m_strLic ); msg.flFlags = MAPI_NEW_SESSION; msg.nRecipCount = 1; msg.lpRecips = &desc;
HINSTANCE hInst = LoadLibrary("MAPI32.dll"); int (_stdcall *pfnSendMail)( LHANDLE, ULONG,lpMapiMessage, FLAGS, ULONG) = (int (_stdcall *)( LHANDLE, ULONG,lpMapiMessage, FLAGS, ULONG))GetProcAddress(hInst, "MAPISendMail");
ULONG (_stdcall *pfnLogon)(ULONG, LPTSTR, LPTSTR, FLAGS, ULONG, LPLHANDLE) = (ULONG (_stdcall *)(ULONG, LPTSTR, LPTSTR, FLAGS, ULONG, LPLHANDLE)) GetProcAddress(hInst, "MAPILogon");
LHANDLE pSession; int iErr = (*pfnLogon)(0,"",NULL,MAPI_LOGON_UI,0, &pSession); if(iErr != SUCCESS_SUCCESS) { AfxMessageBox("Logon of MAPI-Profile failed"); return; } iErr = (*pfnSendMail)(pSession,(ULONG)0, &msg, MAPI_LOGON_UI, 0); if(iErr != SUCCESS_SUCCESS) { AfxMessageBox("Sending of the mail failed"); return; } }
nu vot i vsje, nado tolko zamenit' MFC-shnyje dela tipa Afx... na sootv. Qt
|