Sending An E-mail Using Automation

Who can post a snippet of code which shows how to send an e-mail using Automation. Don’t forgot to mention the subtype (name) for the Automation C/AL variables. I started to using MAPI when I realised that for this project the Customer do not have C/OCX in their licence and are not willing to buy it :frowning:

Hello Tarek: This code is to send a e-mail with Outlook. autOutlookApp Automation ‘Microsoft Outlook 9.0 Object Library’.Application autOutlookNameSpace Automation ‘Microsoft Outlook 9.0 Object Library’.NameSpace autOutlookMessage Automation ‘Microsoft Outlook 9.0 Object Library’.MailItem CREATE(autOutlookApp); autOutlookNameSpace := autOutlookApp.GetNamespace(‘MAPI’); autOutlookMessage := autOutlookApp.CreateItem(0); autOutlookMessage.Recipients.Add(‘’); autOutlookMessage.Subject := ‘Subject’; autOutlookMessage.HTMLBody := ‘Body’; autOutlookMessage.Display; CLEAR(autOutlookMessage); CLEAR(autOutlookNameSpace); CLEAR(autOutlookApp);

Unless you have a specific reason to use automation & Outlook, you may also consider using the mapi32.ocx that comes with the Navision Install disk. Also, you can then use the “Mail” codeunit as an example of how to do it. Just an idea. Bill Benefiel Manager of Information Systems Overhead Door Company (317) 842-7444 ext 117