Dear,
This the full code of using the mapi send mail and teh other functions available in the
MAPI.Hope this is helpfull to you.
Just copy the code and compile it and run it in dos prompt.
Bye
JItendar
#include <windows.h>
#include <stdio.h>
#include <mapi.h>
LPMAPILOGON lpfnMAPILogon;
LPMAPISENDMAIL lpfnMAPISendMail;
LPMAPILOGOFF lpfnMAPILogoff;
MapiRecipDesc recipient =
{
0, MAPI_TO,
"Friend", "SMTP:jitendar.rawat@igiindia.com",
0, NULL
};
MapiMessage message =
{
0, "Warning",
"Hello,Jitu how are you\n",
NULL, NULL, NULL, 0, NULL, 1, &recipient, 0, NULL
};
void main(void)
{
LHANDLE lhSession;
HANDLE hMAPILib;
hMAPILib = LoadLibrary("MAPI32.DLL"

;
lpfnMAPILogon =
(LPMAPILOGON)GetProcAddress(hMAPILib, "MAPILogon"

;
lpfnMAPISendMail =
(LPMAPISENDMAIL)GetProcAddress(hMAPILib, "MAPISendMail"

;
lpfnMAPILogoff =
(LPMAPILOGOFF)GetProcAddress(hMAPILib, "MAPILogoff"

;
(*lpfnMAPILogon)(0, NULL, NULL, 0 , 0, &lhSession);
(*lpfnMAPISendMail)(lhSession, 0, &message, 0, 0);
(*lpfnMAPILogoff)(lhSession, 0, 0, 0);
printf("Message to the White House sent.\n"

;
FreeLibrary(hMAPILib);
}