Codeunit 400 smtp Library not registered

jelittlejohnjelittlejohn Member Posts: 61
I have a client who recently installed a new 64 bit server. They are using a SQL database so I migrated the data and then installed the middle tier, RTC, NAS, and classic client on the new server. All this went successfully. We we able to get all clients connected and everything is working well. However, we have been using the NAS to send out nightly reports via email using codeunit 400. When I test this I get the following error:

Then SMTP mail system returned the following error: (0x8002801D): Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

I have read all of the related posts here and have attempted to register the library several times. I have registered it from it's natural location on common files and from the directory holding the classic client. However, no matter what I do, when I run my test codeunit (just sends me a one line email), I always get this error. The thing I cannot understand is that when I open codeunit 400, I can see the automation object so I would think that it is properly registered.

Does anyone have any ideas? This all worked perfectly on the old server which I believe was a 32 bit server so I'm wondering if it is a 64 bit issue. I'm tempted to turn the old server back on just to run NAS but I'm sure the client does not want to do that.

Thanks in advance!
Jack Littlejohn
Clemson, SC

Answers

  • bbrownbbrown Member Posts: 3,268
    I use Codeunit 400 on many 64 bit servers. So I can tell you that this is not a 32/64 bit issue.
    There are no bugs - only undocumented features.
  • jelittlejohnjelittlejohn Member Posts: 61
    You are correct bbrown. Since my original post, I realized that I also have codeunit 400 running successfully on a 64 bit machine. However, the client where I have it running successfully on the 64 machine also gave me another example of the identical failure. This client has two servers running, one which is the domain controller and a second that is primarily for running their SQL server installation. I also needed to run codeunit 400 through the NAS for this client. When I tried to get NAS running on the Domain controller server, I got the same "Library Not Registered" error that I am currently addressing. My solution there was to just give up on the domain controller server and run it from the SQL server where it worked perfectly (both servers are 64 bit).

    The only thing I can see that the two problem servers have in common is that they are both running Exchange. I can't imagine this being the issue but I am grasping at straws. I currently have NAS running successfully on the client's old server but it is a short term fix as it is sitting in the middle of the floor and they do not have a long term location for it.

    This weekend, I plan to uninstall and re-install all NAV compnents on the box and see if that helps at all. I have already tried uninstalling and re-installing the NAS and Classic client without success.

    Any thoughts or ideas would be appreciated.
    Jack Littlejohn
    Clemson, SC
  • RallnusRallnus Member Posts: 79
    what was the solution?
    Rallnus (Yamaha FJ1200 - '89 / 25th anniversary was great!)
  • jelittlejohnjelittlejohn Member Posts: 61
    Well, I never came up with a solution but I did find out why I was having the problem. I had the RTC middle tier running on the client's primary server which was also hosting their Microsoft Exchange server. The installation of Microsoft Exchange did something (overwrote/modified/deleted) to the dll that is used by codeunit 400 to send smtp email. This is why I was getting the Library Not Found error. I have since verified the same issue on multiple client servers. If you want to use code unit 400, you cannot do it from a server that is also hosting Microsoft Exchange. The best case solution is to have multiple servers, one with Microsoft Exchange & one hosting the middle tier service.

    Even though this did not solve the problem, I think I will mark it as such as this info can save someone a lot of time searching for an answer.
    Jack Littlejohn
    Clemson, SC
Sign In or Register to comment.