Mail OCX in Navision

Hi, I have a problem, writing an HTML file and try to E-mail this file by using the Mail-OCX in Navision. Here is my code: //Send Email to Customerservice rep when receiving new WebOrder IF WebSetup.SendEmailOnConfirm THEN BEGIN WebOrder3.SETRANGE(“No.”,WebOrder2.“No.”); CLEAR(WebOrderConfirm); WebOrderConfirm.SETTABLEVIEW(WebOrder3); IF WebOrderConfirm.SAVEASHTML(‘C:\WebOrderConfirm.htm’) THEN Mail.NewMessage(WebSetup.SystemEmailAddress,’’,STRSUBSTNO(‘New WebOrder# % 1’,WebOrder2.“No.”),’’,‘C:\WebOrderConfirm.htm’,False); END; I get the following error: ‘This message is for C/AL programmers: The call to member Action failed. MAPIMessages returned the following message: Unspecified failure has occured.’ Basically, what I’m trying to do is to automate Navision to import weborders, convert them to salesorders and send emails for each converted weborder. All possible errors are being captured or being sent to a log file. All the code is run by a timer and the timer is set to a couple of minutes. What is listed above is the code what handles the email. Who can help me out? Thanks, Roelof.

Hi Ralph, Thanks for your reply. I downloaded Microsoft internet explorer 5.5 SP1 and installed it. But I still have the same OCX file (msmapi32.ocx, version 5.0). So, I’m not sure in what way you solved the problem because the ‘Mail’ Codeunit in Navision is only using this ocx. Roelof.

Check out which msmapi32.ocx you are using. When you install NF 2.6 your original ocx is replaced by a new ocx installed in your navision client directory. You should use the ocx installed in c:\winnt\system32. Try to register the original ocx with regsrv32 from your command prompt

Hi Magnus, Yes, I checked both OCX’s. But I have still the problem.

I solved my problem. It was not the ocx what caused my problem but the html report. For some reason Navision didn’t create one. Thats why I got that error with the mapi ocx. But thanks for all the help. Roelof.