I can't find the original ASP file with this code, but here is a sample of
mine:

With ASP it is really easy.  Having everything in a database, this is all
you do:

' Set the variables below to match your mail server configuration
Domain = "mail.central.pl"
Alias = "central.pl"
UserDir = "E:\YOUR_USERDIRECTORY\"

IMailServerURL = "http://www.central.pl/main.htm"
Maxsize = 5242880
MaxMsgs = 1000
Flags = 128
AcctType = 0

UserID = Request("UserID")
UserID = LCASE(UserID)
Password = Request("Password")
Password2 = Request("Password2")
FullName = Request("FullName")
MailAddr = UserID&"@"&Alias
UserDir = UserDir&"\"&UserID
IPAddress = Request.ServerVariables("REMOTE_ADDR")
Table = "MAIL_CENTRAL_PL"

SQLConnectImail="this is your DSN string..."

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open SQLConnectImail
CheckExists = "SELECT UserID, MailAddr FROM "&Table&" WHERE UserID =
'"&UserID&"' OR MailAddr = '"&MailAddr&"'"
Set rs = Conn.Execute(CheckExists)

If rs.EOF Then
' this measn that a user like this was not found...

InsertMailUser = "INSERT INTO "&Table&" (UserID, Password, FullName,
UserDir, MailAddr, Maxsize, MaxMsgs, Flags, Type, IPAddress) "&_
                "VALUES('"&UserID&"', '"&Password&"', '"&FullName&"', '"&UserDir&"',
'"&MailAddr&"', "&Maxsize&", "&MaxMsgs&",               "&Flags&", "&AcctType&",
'"&IPAddress&"')"

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open SQLConnectImail
Set rs = Conn.Execute(InsertMailUser)

Else
' a user like this was already found so try again.
Response.Redirect("NewAccount.asp)
End If


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jason Heckathorn
> Sent: Tuesday, April 04, 2000 4:38 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [IMail Forum] How to create a user whilst online and
> not using web mail
>
>
> How does one use an ASP script to add a user?  Can ASP scripts
> also be used
> to access user information and accounts?  I'm currently using the internal
> imail database.  Would I need to switch to SQL server to do these things?
> Thanks.
> jason heckathorn
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Marcin Zastawny
> Sent: Tuesday, April 04, 2000 9:25 AM
> To: IMail_Forum
> Subject: RE: [IMail Forum] How to create a user whilst online and not
> using web mail
>
>
> Depends on how you have configured your domain - whether it is
> storing user
> account details in a database or in the registry.
> If it is in a database then you just insert that record into the database.
> If it is in the registry then use the utility adduser.exe.
> Most of all this can be done in an ASP script, and I recommend
> using an ODBC
> database (like Access, SQL Server or Oracle, depends on how many users you
> want to service)
>
> regards,
> Marcin
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Chris Gurney
> > Sent: Tuesday, April 04, 2000 2:41 PM
> > To: IMail_Forum
> > Subject: [IMail Forum] How to create a user whilst online and not
> > using web mail
> >
> >
> > Is it possible to create a user whilst online.
> >
> > I want to be able to request a user name and password from a potential
> > subscriber to my site and then give them an email account as part of the
> > deal.
> >
> >
> > [EMAIL PROTECTED]
> >
> > Please visit http://www.ipswitch.com/support/mailing-lists.html
> > to be removed from this list.
> >
>
> Please visit http://www.ipswitch.com/support/mailing-lists.html
> to be removed from this list.
>
>
> Please visit http://www.ipswitch.com/support/mailing-lists.html
> to be removed from this list.
>

Please visit http://www.ipswitch.com/support/mailing-lists.html 
to be removed from this list.

Reply via email to