MAPI in C

I want to write a simple Email client that will allow my software to Generate a report and Fax it via an email interface to a Fax Server or Simply Email it to a normal email address. I am writing in Normal C (not C++). Where should I start. Are there any simple examples.
LVL 1
philsmicronetAsked:
Who is Participating?
 
cdesignerConnect With a Mentor Commented:
this sample open new mail with attachment



void SendMail(LPCSTR path)
{
    m_hInstMail = ::LoadLibrary("MAPI32.DLL");

    ULONG (PASCAL *lpfnSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);
    (FARPROC&)lpfnSendMail = GetProcAddress(m_hInstMail, "MAPISendMail");
        if (lpfnSendMail == NULL)
        {
                OnError("MAPI: Inicialization error");
                ::FreeLibrary(m_hInstMail);
                return;
        }

     // prepare the file description (for the attachment)
     MapiFileDesc fileDesc;
     memset(&fileDesc, 0, sizeof(fileDesc));
     fileDesc.nPosition = (ULONG)-1;
     fileDesc.lpszPathName = path;
     // prepare the message (empty with 1 attachment)
     MapiMessage message;
     memset(&message, 0, sizeof(message));
     message.nFileCount = 1;
     message.lpFiles = &fileDesc;
     int nError = lpfnSendMail(0, (ULONG)NULL,&message, MAPI_LOGON_UI|MAPI_DIALOG, 0);
     if (nError != SUCCESS_SUCCESS && nError != MAPI_USER_ABORT && nError != MAPI_E_LOGIN_FAILURE)
     {
             OnError("MAPI: send message error");
     }
     ::FreeLibrary(m_hInstMail);
}
0
 
vachoohoCommented:
see MAPI.h header file
0
All Courses

From novice to tech pro — start learning today.