Skip to main content

I use the API MAPISendMail.

How can i declare more then one Recipient?

I use the API MAPISendMail.

How can i declare more then one Recipient?

The MapiRecipient structure can be an array where each entry specifies one recipient.

Then in your mapi structure you can set the MapiMsgnRecipCount field to the number of entries in the array.

Example:

move 5 to MapiMsgnRecipCount      

set MapiMsglpRecips to address of MapiRecipient

01  MapiMsgStruct.                                            

   03 MapiMsgulReserved       ulong            value 0.      

   03 MapiMsglpszSubject      pointer          value null.    

   03 MapiMsglpszNoteText     pointer          value null.    

   03 MapiMsglpszMessagetype  pointer          value null.    

   03 MapiMsglpszDateReceived pointer          value null.    

   03 MapiMsglpszConversation pointer          value null.    

   03 MapiMsgflflags          pic 9(9) comp-5  value 0.      

   03 MapiMsglpOriginator     pointer          value null.    

   03 MapiMsgnRecipCount      ulong            value 0.      

   03 MapiMsglpRecips         pointer          value null.    

   03 MapiMsgnFileCount       ulong            value 0.      

   03 MapiMsglpFiles          pointer          value null.    

**** Mail Recipient                                            

01 MapiRecipient.

   05 Recipient-table occurs 5 times.                                              

        10 MapiReculReserved       ulong            value 0.      

        10 MapiReculRecipClass     ulong            value 0.      

        10 MapiReclpszName         pointer          value null.    

        10 MapiReclpszAddress      pointer          value null.    

        10 MapiReculEIDSsize       ulong            value 0.      

        10 MapiReclpEntryId        pointer          value null.