PROBLEMS with MAPIHandler

I’m trying to use the MAPIHandler to send emails to a list of email addresses, and I always get an error about the string I’m using. If i try to send just one email, it works OK, but when I try to send a list of addresses, it gives an error. I’m using the character ‘;’ to chain the adresses. Does anyone know how to send a list of email addresses to the property “Toname” of MAPIHandler? example of what i’m doing now email1@email.es;email2@email.es any help? TIA

You must use for each email adress ‘ToName’ Here is a sample, which I use: FOR Y := 1 TO X DO BEGIN MAPIMessage.RecipIndex := MAPIMesassage.RecipCount; MAPIMessage.RecipType := 1; MAPIMessage.RecipDisplayName := Mail_An[Y]; END; IF CCName <> ‘’ THEN BEGIN MAPIMessage.RecipIndex := MAPIMessage.RecipCount; MAPIMessage.RecipType := 2; MAPIMessage.RecipDisplayName := CCName; END; Regards Carsten Weege HUTH Elektronik Systeme GmbH

Please note that the MAPIHandler control is not the same as the MAPIMessage/MAPISession control. The latter one was used in older versions of Navision, but certain limitations (e.g. body text size) must have convinced the developers at Navision that another approach was required. I don’t think MAPIHandler is capable of handling more than one recipient per message. Kind regards, Jan Hoek

I found the same problem. I solved it by using the Office Outlook Automation object. I used the following code to send an e-mail to one recipient and multiple cc-recipients. I pass an array to the function. Pos 1 of the array is the main recipient. Pos 2 til cccount wil be used for CC Variables MailItem Automation ‘Microsoft Outlook 10.0 Object Library’.MailItem Outlook Automation ‘Microsoft Outlook 10.0 Object Library’.Application Recipients Automation ‘Microsoft Outlook 10.0 Object Library’.Recipients Recipient Automation ‘Microsoft Outlook 10.0 Object Library’.Recipient i Integer function SendMail (CC : Array[10] of text ; cccount : integer ; subject : text) CREATE (Outlook); MailItem := Outlook.CreateItem (0); Recipients := MailItem.Recipients; Recipients.Add (CC[1]); FOR i := 2 TO cccount DO Recipients.Add (CC[i]); Recipients.ResolveAll; FOR i := 2 TO cccount DO BEGIN Recipient := Recipients.Item (i); Recipient.Type := 2; // Type 1 = Main recipient Type 2 = CC Type 2 = BCC END; MailItem.Subject := Subject; MailItem.Send; // Use MailItem.Save if you want to verify the correctness of the e-mail message. The message will be stored in the Outlook drafts folder CLEAR (Recipient); CLEAR (Recipients); CLEAR (MailItem); CLEAR (Outlook);