Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is my MAPI solution:</p> <pre><code>#include &lt;tchar.h&gt; #include &lt;windows.h&gt; #include &lt;mapi.h&gt; #include &lt;mapix.h&gt; int _tmain( int argc, wchar_t *argv[] ) { HMODULE hMapiModule = LoadLibrary( _T( "mapi32.dll" ) ); if ( hMapiModule != NULL ) { LPMAPIINITIALIZE lpfnMAPIInitialize = NULL; LPMAPIUNINITIALIZE lpfnMAPIUninitialize = NULL; LPMAPILOGONEX lpfnMAPILogonEx = NULL; LPMAPISENDDOCUMENTS lpfnMAPISendDocuments = NULL; LPMAPISESSION lplhSession = NULL; lpfnMAPIInitialize = (LPMAPIINITIALIZE)GetProcAddress( hMapiModule, "MAPIInitialize" ); lpfnMAPIUninitialize = (LPMAPIUNINITIALIZE)GetProcAddress( hMapiModule, "MAPIUninitialize" ); lpfnMAPILogonEx = (LPMAPILOGONEX)GetProcAddress( hMapiModule, "MAPILogonEx" ); lpfnMAPISendDocuments = (LPMAPISENDDOCUMENTS)GetProcAddress( hMapiModule, "MAPISendDocuments" ); if ( lpfnMAPIInitialize &amp;&amp; lpfnMAPIUninitialize &amp;&amp; lpfnMAPILogonEx &amp;&amp; lpfnMAPISendDocuments ) { HRESULT hr = (*lpfnMAPIInitialize)( NULL ); if ( SUCCEEDED( hr ) ) { hr = (*lpfnMAPILogonEx)( 0, NULL, NULL, MAPI_EXTENDED | MAPI_USE_DEFAULT, &amp;lplhSession ); if ( SUCCEEDED( hr ) ) { // this opens the email client with "C:\attachment.txt" as an attachment hr = (*lpfnMAPISendDocuments)( 0, ";", "C:\\attachment.txt", NULL, NULL ); if ( SUCCEEDED( hr ) ) { hr = lplhSession-&gt;Logoff( 0, 0, 0 ); hr = lplhSession-&gt;Release(); lplhSession = NULL; } } } (*lpfnMAPIUninitialize)(); } FreeLibrary( hMapiModule ); } return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload