Runtime Error when use codeunit 397 to send mail

I use codeunit 397 to send mail like below


The system show error “Rintime Error” and Navision is blockecd

But if I set OSendMail.OpenDialog := Ture


The system is runing normal and I must to send the mail manual.

Hi Chao,

Firstly, welcome to the Dynamics User Group!

What version of Nav are you using?

There are problems with some version of OLHANDLER.DLL (search the forum for post on this)

The Version is NAV 2009 R2 running on windows XP SP3


Hi Chao,

Did you install the version of Nav or running from a folder/shortcut?

Try re-installing the Nav client.

Have you tried codeunit 400 SMTP Mail ?

Hi Dave

Yes, I install the version of NAV via NAV 2009 R2 pack.

I have try it on several computers. The error is same. Is our Exchange server wrong in any config?


Hi Manish

No, I have not tried


Hi Manish

I have tried codeunit 400 and it’s working normal


That’s g8.

Please verify that solved you problem :slight_smile:

I want use codeunti 397, because I want get Mail GUID.