Microsoft KB Archive/103847: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
Line 42: Line 42:
<div class="notice_section">
<div class="notice_section">


The sample code on page 87 of the version 3.0 Microsoft Mail for PC Networks &quot;Technical Reference&quot; manual contains errors that will cause the code to not work. The following is the corrected sample code:
The sample code on page 87 of the version 3.0 Microsoft Mail for PC Networks "Technical Reference" manual contains errors that will cause the code to not work. The following is the corrected sample code:
<pre class="codesample">void f1()
<pre class="codesample">void f1()
{
{
  long err;
  long err;


  MapiFileDesc file = { 0, 0, -1L, &quot;c:\\tmp\tmp.wk3&quot;, &quot;budget17.wk3&quot;,
  MapiFileDesc file = { 0, 0, -1L, "c:\\tmp\tmp.wk3", "budget17.wk3",
  NULL };
  NULL };
  MapiMessage note = { 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0,
  MapiMessage note = { 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0,
Line 54: Line 54:
  err = MAPISendMail(0L, 0L, &amp;note, MAPI_DIALOG, 0L);
  err = MAPISendMail(0L, 0L, &amp;note, MAPI_DIALOG, 0L);
  if (err != SUCCESS_SUCCESS)
  if (err != SUCCESS_SUCCESS)
     printf(&quot;Unable to send the message\n&quot;);
     printf("Unable to send the message\n");
}
}


Line 61: Line 61:
  long err;
  long err;


  MapiFileDesc file = { 0, 0, -1L, &quot;c:\\tmp\tmp.wk3&quot;, &quot;budget17.wk3&quot;,
  MapiFileDesc file = { 0, 0, -1L, "c:\\tmp\tmp.wk3", "budget17.wk3",
  NULL };
  NULL };
  MapiMessage note = { 0, NULL,&quot;Attached is the budget proposal.\r\nSee
  MapiMessage note = { 0, NULL,"Attached is the budget proposal.\r\nSee
  you Monday.\r\n&quot;,NULL, NULL, NULL, 0, NULL, 2, NULL, 1, &amp;file };
  you Monday.\r\n",NULL, NULL, NULL, 0, NULL, 2, NULL, 1, &amp;file };


  MapiRecipDesc recip[2];
  MapiRecipDesc recip[2];
Line 70: Line 70:
  recip[0].ulReserved = 0;
  recip[0].ulReserved = 0;
  recip[0].ulRecipClass = MAPI_TO;
  recip[0].ulRecipClass = MAPI_TO;
  recip[0].lpszName = &quot;Sally Jones&quot;;
  recip[0].lpszName = "Sally Jones";
  recip[0].lpszAddress = NULL;
  recip[0].lpszAddress = NULL;
  recip[0].ulEIDSize = 0;
  recip[0].ulEIDSize = 0;
Line 77: Line 77:
  recip[1].ulReserved = 0;
  recip[1].ulReserved = 0;
  recip[1].ulRecipClass = MAPI_CC;
  recip[1].ulRecipClass = MAPI_CC;
  recip[1].lpszName = &quot;Marketing&quot;;
  recip[1].lpszName = "Marketing";
  recip[1].lpszAddress = NULL;
  recip[1].lpszAddress = NULL;
  recip[1].ulEIDSize = 0;
  recip[1].ulEIDSize = 0;
Line 86: Line 86:
  err = MAPISendMail(0L, 0L, &amp;note, 0L, 0L);
  err = MAPISendMail(0L, 0L, &amp;note, 0L, 0L);
  if (err != SUCCESS_SUCCESS)
  if (err != SUCCESS_SUCCESS)
     printf(&quot;Unable to send the message\n&quot;);
     printf("Unable to send the message\n");
}
}
         </pre>
         </pre>

Revision as of 08:34, 20 July 2020

Knowledge Base


PC MAPI: DocErr: Send Attachment Sample Code Correction

Article ID: 103847

Article Last Modified on 10/30/2006



APPLIES TO

  • Microsoft Mail Client 3.0



This article was previously published under Q103847

The sample code on page 87 of the version 3.0 Microsoft Mail for PC Networks "Technical Reference" manual contains errors that will cause the code to not work. The following is the corrected sample code:

void f1()
{
 long err;

 MapiFileDesc file = { 0, 0, -1L, "c:\\tmp\tmp.wk3", "budget17.wk3",
 NULL };
 MapiMessage note = { 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0,
 NULL, 1, &file };

 err = MAPISendMail(0L, 0L, &note, MAPI_DIALOG, 0L);
 if (err != SUCCESS_SUCCESS)
     printf("Unable to send the message\n");
}

void f2()
{
 long err;

 MapiFileDesc file = { 0, 0, -1L, "c:\\tmp\tmp.wk3", "budget17.wk3",
 NULL };
 MapiMessage note = { 0, NULL,"Attached is the budget proposal.\r\nSee
 you Monday.\r\n",NULL, NULL, NULL, 0, NULL, 2, NULL, 1, &file };

 MapiRecipDesc recip[2];

 recip[0].ulReserved = 0;
 recip[0].ulRecipClass = MAPI_TO;
 recip[0].lpszName = "Sally Jones";
 recip[0].lpszAddress = NULL;
 recip[0].ulEIDSize = 0;
 recip[0].lpEntryID = NULL;

 recip[1].ulReserved = 0;
 recip[1].ulRecipClass = MAPI_CC;
 recip[1].lpszName = "Marketing";
 recip[1].lpszAddress = NULL;
 recip[1].ulEIDSize = 0;
 recip[1].lpEntryID = NULL;

 note.lpRecips = recip;

 err = MAPISendMail(0L, 0L, &note, 0L, 0L);
 if (err != SUCCESS_SUCCESS)
    printf("Unable to send the message\n");
}
        


Additional query words: 3.00

Keywords: KB103847