This procedure explains how to run SMTP component from NAV 5.0 in older versions. This was tested in Navision 4.0 SP3. Not all countries had NAV 5.0 a localized release.
If you don’t want this manual procedure of registering components you could also install NAV 5.0 client in same computer you are running NAV 4.0 SP3.
Manual Procedure:
1 – Copy “Microsoft.Navision.Mail.dll” and “Microsoft.Navision.Mail.tlb” from NAV 5.0 installation CD to NAV 4.0 client folder.
2 – You need to run regasmexe. This tool is located in “C:\Program Files\Tools;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727”. When you run this tool you could add it to windows path or insert full path when running.
3 – In Navision client folder execute regasm Microsoft.Navision.Mail.dll /tlb:Microsoft.Navision.Mail.tlb
4 – Export fowling objects from NAV 5.0 to NAV 4.0
Form – 409 SMTP Mail Setup
Codeunit – 400 - SMTP Mail
Table – 409 - SMTP Mail Setup
Now you can use codeunit SMTP Mail to send e-mails instead of using 3rd party components or writing new one in .NET.
Copy from my Blog:
http://dynamicsuser.net/blogs/nunomaia/archive/2007/09/10/running-smtp-component-from-nav-5-0.aspx
Comments
I tried to register the dll as per your instruction but it gives error
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
SMTP componet registered successfully. Sending messages works just fine when running customized CU manually from Object Designer.
But when trying to run same CU with NAS, CREATE(Mail) gives following error:
Could not create an instance of the OLE control or Automation server identified by
GUID={68AEAA7B-9523-3511-AF5F-F2381D2C6F04} 1.0:{F9DAE2A4-D2F8-37C3-86D5-E4FFE166D860}:'Microsoft Navision Mail'.SmtpMessage.
We are using NAV 4.0 S3 (25143) and SQL 2005.
Any ideas how to resolve this problem?
Thanks in advance.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Fortunately at last I figured out how to get it work. I registrered dll from client directory and NAS is installed in different directory. Just copying dll and tlb files from client directory to NAS directory will solve this problem. It's unclear to me why NAS needs these files in his directory but it helps:)
Thanks for sharing.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I have copied “Microsoft.Navision.Mail.dll and Microsoft.Navision.Mail.tld” in client folder (4.0 SP3), at the same time I have imported objects from 5.0 which are required for SMTP technology. But when I am sending the mail system giving this error.
Could not create an instance of the OLE control or Automation server identified by
GUID={68AEAA7B-9523-3511-AF5F-F2381D2C6F04} 1.0:{F9DAE2A4-D2F8-37C3-86D5-E4FFE166D860}:'Microsoft Navision Mail'.SmtpMessage
check the OLE Control or Automation Server Correctly installed and registered.
plz can anyone give solution for this.
Thanks
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
For example you will use your "Microsoft.Navision.Mail.dll" us must copy this file FROM a PC where it has been installed to the PC where it is missing.
Then you open the CMD and use the regsvr32.exe to register your dll in the windows registry.
When registration is successful, a message popps up and you can use this dll as Automation variable under NAVision.
To unregister use the parameter
Regards
You can search for the exe in windows directory somewhere. from cmd prompt you type
REGASM MyAssembly.dll /tlb:MyAssembly.tlb
To uninstall.
REGASM /u MyAssembly.dll /tlb:MyAssembly.tlb
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for giving examples. I have registered the both DLL’s successfully (by taking of your examples) but still I am getting the same error message.
Thanks & Regards
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Any ideas besides installing 5.0 on the machine?
REGASM MyAssembly.dll /tlb:MyAssembly.tlb /codebase
the codebase parameter solved a .NET DLL file i was trying to register.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I might have something else that will help people with this never ending DLL issue. It works but I do not know WHY it works. Or why it breaks in the first place.
I am currently working on upgrading our 3.6(5) system to Nav2009 complete.
As part of this I installed the Nav2009 client on 10 user PCs who were all going to test for me.
On some PCs... but not all.... the Navision Mail DLL simply stopped functioning. Especially when trying to "Show" a navision stored email in Outlook.
Not only were the problems random but the fixes were too. A fix on one PC did not work on another.
Fixes that worked for me:
1) Unregistering and re-registering the NSAPPhandler DLL.
2) Unregistering and re-registering the Navision Mail DLL using Regasm and TLB etc. As another user stated its best to use the DLL in the Client directory and NOT the one that is in the "Common Files" directory. When I use the latter it often (but not always AGAIN) does not work.
3) Rolling back to the 2007 file (version 5) of NSApphandler.
and the weirdest one:
4) Deleting entirely the Outlook profile for the user and setting it up again... or in fact deleting the entire profile for that user off the PC and letting the user log in again to get a new profile built.
The last one is a mystery to me as to why it works!!! We only tried it because one user had the mail fail issue and nothing we tried worked. But we noticed that when we logged in with another user on that PC it was fine. And when that user logged in on another PC it was fine. It really was just this one user-machine combination failure.
So we hit on the idea of just deleting her profile on that machine entirely and then letting her log in again. Problem was gone!!! It was not a ZUP file issue either as I had already tried deleting that.
On Monday we will be installing Nav 2009 classic client on ALL PCs in our company as a prelude to upgrading the Database next weekend. Then they will all come in Monday morning and use the new client.
I envision most of Monday being wasted battling the above Email problem on random PCs all over the company. ARGH! :-(