Results 1 to 3 of 3

Thread: Correct path?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Correct path?

    Hello

    My 'forgotten password' page does not send any email to the user which would otherwise contain a link tom reset the password. When the link is clicked, a new page, newPassword.aspx, should be displayed for the user to reset the password.

    I am trying to identify why the email is not being sent. In my code, I have this:

    Code:
      If recordExists Then
    
                Dim builder As New UriBuilder(Request.Url)
                builder.Path = VirtualPathUtility.ToAbsolute("~/newPassword.aspx")
                builder.Query = "uniqueCode=" & HttpUtility.UrlEncode(uniqueCode)
    
                Dim link As String = builder.Uri.ToString()
                Dim myMessage As New MailMessage
                Dim Smtpserver As New SmtpClient
    The file, newPassword.aspx in this code is taking a tilde, and I wonder if that is correct when both forgot.aspx and newPassword.aspx appear together (not in their own separate folders) in Solution Explorer:

    Name:  SolutionExplorer.jpg
Views: 262
Size:  43.1 KB

    It may be that I am barking up the wrong tree completely but as I say, I am attempting to identify the source of why the forgot.aspx page is not sending the email or launching newPassword.aspx.

    Thanks.

  2. #2
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Correct path?

    What is the url contained in the email? Does it look like it should be going to the correct page?

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Correct path?

    Quote Originally Posted by SteveHi View Post
    Hello

    My 'forgotten password' page does not send any email to the user which would otherwise contain a link tom reset the password. When the link is clicked, a new page, newPassword.aspx, should be displayed for the user to reset the password.

    I am trying to identify why the email is not being sent. In my code, I have this:

    Code:
      If recordExists Then
    
                Dim builder As New UriBuilder(Request.Url)
                builder.Path = VirtualPathUtility.ToAbsolute("~/newPassword.aspx")
                builder.Query = "uniqueCode=" & HttpUtility.UrlEncode(uniqueCode)
    
                Dim link As String = builder.Uri.ToString()
                Dim myMessage As New MailMessage
                Dim Smtpserver As New SmtpClient
    Where's the rest of the code? That's only a part of it, and that part doesn't actually create or send the email...

    Quote Originally Posted by SteveHi View Post
    The file, newPassword.aspx in this code is taking a tilde, and I wonder if that is correct when both forgot.aspx and newPassword.aspx appear together (not in their own separate folders) in Solution Explorer:

    Name:  SolutionExplorer.jpg
Views: 262
Size:  43.1 KB

    It may be that I am barking up the wrong tree completely but as I say, I am attempting to identify the source of why the forgot.aspx page is not sending the email or launching newPassword.aspx.

    Thanks.
    It may or may not be right, but until the email is sent, we won't know. So for now, that's irrelevant.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width