Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email Required On Account Creation.
#1
Having a email verafaction is good just in case people loose there passwords, and also good for warnings and ban reasons instead of the msgbox.

---------
Basicly easy to copy and paste 2/5
Understanding 3/5

///CLIENT SIDE///


Make your SendNewAccount Look like this.

Code:
Sub SendNewAccount(ByVal Name As String, ByVal Password As String, ByVal Email As String)
Dim Packet As String

    Packet = "newaccount" & SEP_CHAR & Trim(Name) & SEP_CHAR & Trim(Password) & SEP_CHAR & Trim(Email) & SEP_CHAR & END_CHAR
    Call SendData(Packet)
End Sub

Add these into ModConstants

Now add:
Code:
Public Const MENU_STATE_EMAIL = 9

Right now add:
Code:
Public Const EMAIL_LENGTH = 50

Now Find Private SUb Pic_Connect in frmNewaccount and add:

Code:
If Trim(txtName.Text)  "" And Trim(txtPassword.Text)  "" And Trim(txtEmail.Text)  "" Then

Now find Public Sub MenuState(ByVal State As Long) and go to Call SendNewaccount and add:

Code:
frmNewAccount.txtEmail.Text


Now on form frmNewAccount add these:
A text Box with the name of txtEmail and set the caption to nothing(THE NAME OF THE TEXT BOX MATTERS)
Put a label and call it labelemail and set the caption to Email (Doesn't matter on the name of the label)

Ok thats all for Client Side..

///Server Side///

Make your AddAccount look like this:

Code:
Sub AddAccount(ByVal index As Long, ByVal Name As String, ByVal Password As String,ByVal Email As String)
Dim i As Long

    Player(index).Login = Name
    Player(index).Password = Password
    Player(index).Email = Email
    
    For i = 1 To MAX_CHARS
        Call ClearChar(index, i)
    Next i
    
    Call SavePlayer(index)
End Sub

Add Under AccountRec:

Code:
Type EmailRec
    Email As String * EMAIL_LENGTH
End Type

And Now in AccountRec add to the bottom of it:
Code:
Email as string

Now go to ModConstants and add the 2 following constants:

Code:
Public Const EMAIL_LENGTH = 50
Code:
Public Const MAX_EMAIL = 15

Under HandleData add :
Code:
Dim Email As String

Add Under New account Packet

Code:
Email = Parse(3)

And just below that add next to
Code:
Or Len(Trim(Password)) < 3

Code:
Or Len(Trim(Email)) < 15

now find If Not AccountExist(Name) Then change the line Call AddAccount(index, Name, Password) to look like this:

Code:
Call AddAccount(index, Name, Password, Email)

Now find
Code:
Call PutVar(FileName, "GENERAL", "Password", Trim(Player(index).Password))

and add under it.

Code:
Call PutVar(FileName, "GENERAL", "Email", Trim(Player(index).Email))

I think thats about it msn me if there is any problems
Reply
#2
How would you add a "forgot password" button.
Reply
#3
add a button then setup either email to ask and have a auto responce with the account name and email in the email, or have it so there are 2 text boxes that have email and account name and then when you click ok it will send you a email. I could try code this if you want me to.
Reply
#4
Hmm would be better if it was email verification. It's a bit useless at the moment but it's a good start.
Reply
#5
How do you send email from vb was my real question.
Reply
#6
Perhaps this can help: http://www.devarticles.com/c/a/Visual-B ... ual-Basic/
Reply
#7
http://www.freevbcode.com/ShowCode.Asp?ID=109
Reply
#8
Right im going to work on forgot password button all this weekend, hopefully it wont take that long. Tutorial will be made as soon as i finish.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)