API download

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
kevin@wine.co.za
New user
New user
Posts: 21
Joined: 2007-04-26 12:19
Location: South Africa
Contact:

API download

Post by kevin@wine.co.za » 2013-04-17 17:15

In hmail 4.x I used the great API to manage passwords, vacation messages etc.
But can find no reference to an API for 5.x

Is there an API - and if so, can someone please point me at it ?

Thanks

Bill48105
Developer
Developer
Posts: 6189
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: API download

Post by Bill48105 » 2013-04-17 20:26

hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
mattg
Moderator
Moderator
Posts: 19881
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: API download

Post by mattg » 2013-04-18 00:07

And there were significant changes in the API from 4.X to 5.X
http://www.hmailserver.com/documentatio ... _changelog
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

kevin@wine.co.za
New user
New user
Posts: 21
Joined: 2007-04-26 12:19
Location: South Africa
Contact:

Re: API download

Post by kevin@wine.co.za » 2013-04-18 09:29

Sorry guys - I am still missing something

In 4.x I needed to download a com wrapper that I could use in asp.net ( Interop.hMailServer.dll) and then happily made the API calls once this was in my bin folder / referenced in Visual Studio - but I see no-where to download a version for 5.x

Is there something similar for 5.x?
Or what do I need to do to reference hMailServer.Application in my project ?

User avatar
mattg
Moderator
Moderator
Posts: 19881
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: API download

Post by mattg » 2013-04-18 09:49

kevin@wine.co.za wrote:In 4.x I needed to download a com wrapper that I could use in asp.net
Really?
What specific version of hMailserver 4.X was that?
I started about 8 years ago with 4.2 I think, and I don't remember having to do that.

If your ASP is on the same server as hMailserver, the COM API should already be there.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

kevin@wine.co.za
New user
New user
Posts: 21
Joined: 2007-04-26 12:19
Location: South Africa
Contact:

Re: API download

Post by kevin@wine.co.za » 2013-06-21 09:37

Sorry - went away for a while but now need to resolve this.
I am trying to set up a web interface to change passwords etc. Using .net 4.0 (so not vbs) and hmail 5.3

In .net 2.0 I used to do this by installing Interop.hMailServer in my bin folder for the website , and then I could happily make calls against the API - But I just upgraded to hmail 5.3 and .net 4 and now get 'Cannot create ActiveX component' error.

<%@ Register TagPrefix="hMailServer" Namespace="hMailServer" Assembly="Interop.hMailServer" %>
Dim obApp = CreateObject("hMailServer.Application")

What I think I need to do is wrap the COM API / register the dll - but I don't know which one I need to register / place in my bin folder ?

Or if anyone else has suggestions on a web based password change system using .net

Any help very much appreciated

percepts
Senior user
Senior user
Posts: 5282
Joined: 2009-10-20 16:33
Location: Sceptred Isle

Re: API download

Post by percepts » 2013-06-21 10:07

the COM API is installed with 5.3.x by default. However, I would suggest you install the very latest 5.4.x beta version of hmail server which is about to be released any day. i.e. its fully tested and ready to go live with over 1000 downloads already.

Then take a look at following ASP script which should show/provide you with code and how to access com api from ASP

http://www.hmailserver.com/forum/viewto ... 20&t=20186

If you have PHP on your server you could just run PHPWebAdmin and save yourself a lot of work. You will find folder PHPWebAdmin in your hmailserver folder. Just copy the whole PHPWebAdmin folder into your webserver, change a line in the config file and it should work providing you have PHP installed. The Above ASP light version may do what you want so check that first if you must use ASP.

p.s. in your script editor object browser, you should be able to load the com api and view all the classes, methods and properties. Its called "hMailserver Type Library" on my windows 7 system.

p.p.s. In VS Express 2012 object browser / custom component set / COM / hMailserver Type Library

bmanager
Normal user
Normal user
Posts: 57
Joined: 2013-06-12 00:31

Re: API download

Post by bmanager » 2013-06-21 15:18

Hi,

I have the same problem accessing API COM via ASP page.

I get this error

Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
/LM/W3SVC/26/ROOT/global.asa, line 88

Using W2008R2 and IIS 7.5

Is the API COM 32bit or 64bit?

kevin@wine.co.za
New user
New user
Posts: 21
Joined: 2007-04-26 12:19
Location: South Africa
Contact:

Re: API download

Post by kevin@wine.co.za » 2013-06-21 15:25

I am assuming 32 bit
There are a number of articles on the web about running 32 bit under IIS7
Bottom line is you need to change your Pool to 32 bit and the theory says it should work
In Application Pool for the site - in Advanced Settings look for Enable32-Bit applications

bmanager
Normal user
Normal user
Posts: 57
Joined: 2013-06-12 00:31

Re: API download

Post by bmanager » 2013-06-21 15:44

Yep. It's 32 bit.

If I run this code on .asp page

Code: Select all

<% 
    On error resume next 
    if isObject(Createobject("hMailServer.Application")) then 
        response.write "hMS is installed." 
    else 
        response.write "hMS is not installed." 
    end if 
%>  
I get this response "hMS is installed."

Post Reply