Add domain using COM

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:

Add domain using COM

Post by kevin@wine.co.za » 2007-05-29 11:01

I am trying to add a domain using the COM object but have got confused..

Dim obApp = CreateObject("hMailServer.Application")
obApp.Authenticate("1", "2")

Dim obDomain = obApp.Domains.Add("MyDomain.com") ??
obDomain.Active = True
obDomain.Save

How do I tell it what domain to add

Sorry for the doff question - just can't get my head around this one.
I need to do this so that I can add accounts later - and there has to be an active domain in order to add an account.

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

Solved

Post by kevin@wine.co.za » 2007-05-29 11:31

Amazing what a tea break will do ...

Dim obDomain = obApp.Domains.Add()
obDomain.Name = DOMAINNAME
obDomain.MaxMessageSize = 100 'max message size
obDomain.MaxSize = 1000 'max domain size
obDomain.Active = true ' turn it on
obDomain.Postmaster = "postmaster@" & DOMAINNAME
obDomain.Save

Post Reply