0

I want to send a Link that contains a unique identifier and verify the Guid in an another page named login.aspx

So how do I add the link and how do I retrieve the Guid from the login.aspx to compare it to the one I saved in the SQL database...

This is the code

    Sub emailConfirm()
    Dim email As String = txtMail.Text
    Dim nom As String = txtPrenom.Text + txtNom.Text
    Dim pass As String = txtPass.Text
    Dim user As String = txtUserName.Text
    Dim mail As MailMessage = New MailMessage()
    Dim sGUID As String
    sGUID = System.Guid.NewGuid.ToString()
    (I will put the guid in the Sql DB) 
    mail.To.Add(email)
    mail.From = New MailAddress("superman@gmail.com")
    mail.Subject = "Email Comfirmation de nouvel utilisateur"

    Dim Body As String = "Hi " + nom + ", this mail is to confirm your registration" + "Click on    the link to confirm your membership please"+"href="login.aspx?ID="& sGUID"(This is not work...)
    mail.Body = Body

    mail.IsBodyHtml = True
    Dim smtp As SmtpClient = New SmtpClient()
    smtp.Host = "smtp.gmail.com"
    smtp.Port = 587
    smtp.Credentials = New System.Net.NetworkCredential("superman@gmail.com", "1234")
    smtp.EnableSsl = True
    smtp.Send(mail)


End Sub

thanks for your help!!!

Its in Vb.net

FrankSharp
  • 2,552
  • 10
  • 38
  • 49
  • http://vb.net-informations.com/dataset/dataset-sqlserver.htm I'd go with a "SELECT [GUID] FROM [TABLE] WHERE [GUID] = '" + sGUID + "'"; style statement, and a simple if /else statement for comparison. – user978122 Jan 07 '12 at 03:58
  • "href="login.aspx?ID="& sGUID"(This is not work...) I want to add my guid in a link in the mail body ... That the question1 and the question 2 how to retrive the Guid from the aspx.login...... – FrankSharp Jan 07 '12 at 04:01

1 Answers1

1

Step 1: You need to put the full url in the href not just login.aspx.
Example: "href="http://nameofmywebsite.com/login.aspx?ID="& sGUID"

Step 2 On the login page you would retrieve the GUID from the querystring that you passed in the href above. Example:

request.querystring.get("sGUID")

Hope this helps.

user1135379
  • 136
  • 1