For those not using Visual studio

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:

For those not using Visual studio

Post by kevin@wine.co.za » 2007-04-26 12:59

Just to try and understand how to use the API on .Net when not using Visual Studio

What I would normally do is have a dll in my /bin folder in the app on my .Net server and would then be able to access all the classes of that dll.

If I understand your post correctly, the class library that you have written is the dll that I am looking for. If so, could you please send it to kevin@wine.co.za

Second question : Can one not just update the hM database directly, instead of using the API ( i.e) Is it not possible to add and remove records directly from the say hm_Accounts ( taking care of course to ensure data integrity )

Final question : I take it that I would have to have IIS & .Net running on the hMail server in order to use the COM object / your class library (i.e) run the final (web) application on the hMail server

Many thanks

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2007-04-26 18:27

Not sure I understand. How have you created the .NET server when you don't have Visual Studio? The hMailServer COM API is included when installing hMailServer. You can create a interop dll with Visual Studio and distribute it with your application if your app needs to be able to access the hMailServer COM API..

standern
Normal user
Normal user
Posts: 51
Joined: 2007-02-28 11:31
Location: Milan - Italy
Contact:

Post by standern » 2007-04-27 11:13

I don't know if I understood your question, but I write many scripts in C# and HMail and don't use Visual Studio. I use Sharp Develop (Open Source).

Well, the first hing to do, when you open a new project is to let Sharp Develop (or any other IDE) to create for you a proxy class for interop (it will be called Interop.hMailServer.dll).

Once you have this class, you can create any object or call any method exposed by HMail COM library.

Then, of course you can update the hm database directly, but my question is: why should you do that.
So far, I found a method/property/object for everything I needed. It's really very complete.

You don't have to have IIS for running HMail Server.
You might use Apache, PHP and SquirrelMail to get a web access.

Hope I understood correctly your questions.

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

Martin - installing .Net

Post by kevin@wine.co.za » 2007-04-27 11:27

Martin - I just install dotnetfx 2.0 - this then adds .net to IIS
I can then program against this with any editor I choose - all I need are the class libraries / dll's - which I put in the /bin folder
All my development is in web forms, and VS is very clunkly for web pages
Last edited by kevin@wine.co.za on 2007-04-27 11:40, edited 1 time in total.

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

Post by kevin@wine.co.za » 2007-04-27 11:39

standern - thanks for the reply - it was the intgerop.mhmailserver.dll that I was looking for - that in my /bin folder will do the trick

My reason for updating the database directly is I want to add a 'CLIENTID' to the domains table, for billing etc. My thinking was then to allow pwd updates, forwards etc within my existing application - but I will first try the COM object - sounds easier.

My question about IIS was that if I want to use the COM object to allow me to update hM's data/users, does IIS & the COM have to be on the same server? ( I am using web forms )
I assume that I will need IIS & the COM object on the hMailserver because if I call the methods of the COM object, the COM object has to pass the values/requests to the hMailserver and this can only happen if they are on the same server. I think ?

standern
Normal user
Normal user
Posts: 51
Joined: 2007-02-28 11:31
Location: Milan - Italy
Contact:

Post by standern » 2007-04-27 15:52

kevin@wine.co.za wrote:My question about IIS was that if I want to use the COM object to allow me to update hM's data/users, does IIS & the COM have to be on the same server?
The part of the application that uses the COM and the COM have to be on the same server.
You might have an application like this:
Web client <--> WEB GUI (ASP.NET) on IIS Server <--> Your application on HMail Server.
Web client and IIS comunicating with HTTP.
Web Application on IIS and your application on HMail server might comunicate using .NET Remoting or Web Services or any other protocol.

Good luck.

Post Reply