Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
-
fatihfx
- New user
- Posts: 11
- Joined: 2008-06-09 19:30
Post
by fatihfx » 2008-06-12 09:02
when i try add account to a subdomain then get this error :
Code: Select all
Microsoft VBScript runtime error '800a0009'
Subscript out of range
/admin/email_add.asp, line 39
HERE IS THE LINE 39 :
Code: Select all
Set obDomain = obApp.Domains.ItemByName("TEST.DOMAIN.COM")
HERE IS THE COMPLETE CODE
Code: Select all
Dim obApp
Set obApp = CreateObject("hMailServer.Application")
' Authenticate. Without doing this, we won't have permission
' to change any server settings or add any objects to the
' installation.
Call obApp.Authenticate("Administrator", "your-main-hmailserver-password")
' Locate the domain we want to add the account to
Dim obDomain
Set obDomain = obApp.Domains.ItemByName("TEST.DOMAIN.COM")
Dim obAccount
Set obAccount = obDomain.Accounts.Add
' Set the account properties
obAccount.Address = "TEST@TEST.DOMAIN.COM"
obAccount.Password = "secret"
obAccount.Active = True
obAccount.MaxSize = 100 ' Allow max 100 megabytes
obAccount.Save
-
ulas
- New user
- Posts: 26
- Joined: 2006-06-23 14:31
Post
by ulas » 2008-06-14 03:31
/admin/email_add.asp, line 39
satırında ne var orayı yazsan?
muhtemelen kod yazarken asp de hata yapmıssın.
array kullanırken arrayın uzunluğunu yanlış yazmış olabilirsin. ya da atadıgın değişkende bir sorun var.
fazla deger atamışsındır arrayın uzunlugundan.
hesap eklemede sorun olacagını sanmıyorum.
-
fatihfx
- New user
- Posts: 11
- Joined: 2008-06-09 19:30
Post
by fatihfx » 2008-06-14 08:12
arkadaşım yazıyor ya HERE IS THE LINE 39 : diye tekrar yazayım ama:
Code: Select all
Set obDomain = obApp.Domains.ItemByName("TEST.DOMAIN.COM")
-
ulas
- New user
- Posts: 26
- Joined: 2006-06-23 14:31
Post
by ulas » 2008-06-14 16:07
görmemişim
gece dalgınlığı ,
TEST.DOMAIN.COM subdomaini daha önce yaratılmış mı?
kodu kendimde denedim sorunsuz calısıyor
senin aldığın hatayı alabilmek için "test.domain.com" subdomainini Hmailserver üzerinde yaratmadan yaptım.
yani serverda bu subdomain yokken hesap ekleyemiyorum ve senin aldığın hatayı alıyorum.
subdomaini eklersem sorun yok.
-
Kaan1983
- Senior user
- Posts: 595
- Joined: 2007-01-30 16:26
- Location: TÜRKIYE
Post
by Kaan1983 » 2008-06-14 21:32
hMail günlüğüne de bakabilirsen eğer domain eksikliğinden oluşuyorsa hata raporundan birşeyler bulabilirsin...
Benim kodum:
Code: Select all
Dim obApp As New hMailServer.Application()
obApp.Authenticate("****", "*****")
Dim obDomain As hMailServer.Domain
Dim acc As String = Me.TextBox1.Text.ToLower
Dim Dom As String = Me.DropDownList1.SelectedValue.ToString
Dim Sifre As String = Me.TextBox2.Text
obDomain = obApp.Domains.ItemByName(Dom)
Dim obAccount As hMailServer.Account= obDomain.Accounts.Add
obAccount.Address = acc & "@" & Dom
obAccount.Password = Sifre
obAccount.Active = True
obAccount.MaxSize = 100
obAccount.Save()
-
fatihfx
- New user
- Posts: 11
- Joined: 2008-06-09 19:30
Post
by fatihfx » 2008-06-14 21:52
hay Allah bende dikkat etmemişim, subdomain eklenememiş. aslında otomatik eklenmesi gerekiyordu ama siz söyleyince farkettim. belkide helm ile aralarında bir uyumsuzluk vardır deneyip sizede bilgi veririm.