Hi experts
I get the following error when trying to send an email from Nav Classic Client (v5)
Microsoft Dynamics NAV
This message is for C/AL programmers:
Could not invoke the member Send. The OLE control or Automation server returned an unknown
error code.
OK
Here is the code I use (where SMTPMail is CU400 = "SMTP Mail") :
SMTPMail.CreateMessage('John Doe', 'john.doe@contonso.com', 'pamela@microsoft.com', 'Mail title', 'This is the body of the mail', FALSE);
SMTPMail.Send();
END;
The fact is that the same code works on the NAS but not on my client.
So I taught the Automation Server was not correctly registered.
But when using debugger shows that the error rises when calling the automation variable Mail.Send()
Moreover the Automation server is listed in the Automation Server table.
I've searched in the forum but found nothing.
I restarted my computer to refresh the registry.
I tried to declare a new Mail automation variable in CU 400.
Nothing solved my problem. So could you advise please?
Many thanks for your help!
Comments
SMTP service is running.
There is nothing in the event viewer.
It is most likely a permission thingy.
Have you tried other SMTP tools? Can you send emails via SQL Mail? That uses SMPT too. You can also try the SMTP download here on Mibuso, which sometimes gives better error messages.
AFAIK the Microsoft SMTP is based on .NET, the Mibuso SMTP is based on OCX.
We have had this error before and it was definitely a permission issue. If relay has been activated on Exchange, it could have something to do with roaming IP's.
what is your client version?
Microsoft has released a hotfix, KB2499881, for the SMTP "features" in NAV. However this hotfix is only for 2009SP1 and R2. The new set of dll's actually returns the correct error messages and will allow you to set the port and use SSL.
I have to say that I've had good experiences with this hotfix. It actually makes SMTP work better.
I hope this helps,
Regards,
Willy
I'll investigate the permission issue with the internal IT Admin next week.
I'll keep you informed!