I am trying to send an e-mail from a codeunit run by a Navision Application Server without success. The NewMessage function fails and the error number that is detected within the function is 32026. The NAS is running under the windows login of NASMail and an Outlook account for NASMail exists. Nothing appears within Outlook. The codeunit that contains the call to NewMessage is being called by a single instance codeunit that is itself called by Codeunit 1. An email is successfully sent if the codeunit is run manually. The code that is being called is shown below: TestBoolean := Mail.NewMessage(‘x@y.co.uk’, ‘’, //CCName, ‘Test from codeunit z’, //Subject, ‘Test string’, //Body, ‘’, //AttachFileName, FALSE); //OpenDialog); Any suggestions would be appreciated. Simon.
Check that it’s the user running the nas service that has an email profile setup Do You have any errors in the application log?
There is a better option to send mail than using outlook. Especially as you need to run Outlook directly in order to send and receive mails. Outlook is most probably running as a desktop application and NAS is running as a service, most probably the two tasks cannot interact properly. NAS tries to open a instance of Outlook but cannot gain access to the proper account information as mentioned by Lars. We will integrate JMail http://www.dimac.net/default2.asp?M=Products/MenuCOM.asp&P=Products/w3JMail/start.htm in the next version of our AddOn as we have been facing the same problem
We also use JMail to send emails in Navision. We’ve made a codeunit “JMail” which is similar to codeunit “Mail” (397). The freeware version is enough for us. That can be interesting for companies who don’t like spending money. [;)]
The feedback that I have received from Navision support agrees with what Thomas has said. It is not possible to use the standard Mail function to send an e-mail from NAS. Since then I have downloaded free software to send a SMTP e-mail and this works fine.
Hello Simon, I have SMTP work find for me in an installation. But I was unable to send mail to users out side the customers domain. Have you come accross this problem? Regards Graham