Imail Server Express 11.5 Server APi for .Net : Unable to load DLL 'IMailsec.dll': The handle is invalid

0

I am writing a custom application for IMAIl express 11.5 using IMAIl Server API for .Net

I am using the following code:

        Dim DomData As New DomainData()
        DomData.Aliases = "TestALias"

        DomData.HostName = "TestImailDomain.com"
        DomData.TopDir = IMailAPI_NET.IMailSystem.TopDir & "\TestImailDomain.com"
        DomData.UserDBType = DomainData.DBTYPES.IMail
        DomData.UserDB = "TestUserDB"

        DomData.IPAddress = "192.168.1.12"
        DomData.IMEnabled = True
        DomData.MaxSize = 100
        DomData.MaxOutboundSize = 100
        DomData.MaxSingleMessageSize = 100
        DomData.MaxMsgs = 20
        DomData.MaxUsers = 0
        DomData.AllowedLoginAttempts = 20
        DomData.AllowedLoginLockouts = 10
        DomData.DefaultWebReqPwdLevel = 0

        DomData.SaveHost(True)

I get the following error (in api logs created by imail):

9/30/2011 - 10:47 AM : Error : IMailAPI_NET.DomainData.SaveHost-2 : Unable to load DLL 'IMailsec.dll': The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

Please advise.

Thanks.

.net
vb.net
api
dns
asked on Stack Overflow Sep 30, 2011 by Steve Johnson

1 Answer

1

Likely as not, you added IMailAPI_NET.dll as a project dependency, but Visual Studio is not copying over IMailAPI_NET.dll's dependencies.

I would recommend copying the following files from IMail into your project's binary directory: imailsec.dll, mailbox.dll and IpswitchLicense.dll

answered on Stack Overflow Sep 30, 2011 by Brandon Felger

User contributions licensed under CC BY-SA 3.0