Verificação de e-mail de associação do ASP.NET

Tentando criar uma verificação de email em C # com base emEste artigo.

Eu criei uma conta jangosmtp para enviar o email. No entanto, não parece estar funcionando.

Web.config:

  <system.net>
    <mailSettings>
      <smtp>
        <network
             host="relay.example.com" port="25" userName="********" password="********" />
      </smtp>
    </mailSettings>
  </system.net>

Registration.aspx

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" DisableCreatedUser="True">
        <WizardSteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" />
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server" />
        </WizardSteps>
        <MailDefinition BodyFileName="NewAccountTemplate.htm" From="[email protected]" IsBodyHtml="True"  Subject="Steps to activate your new account..." Priority="High" />
    </asp:CreateUserWizard>
</asp:Content>

Registration.aspx.cs:

namespace WebSite
{
    public partial class Registration : System.Web.UI.Page
    {
        protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e)
        {
            //Send an email to the address on file
            MembershipUser userInfo = Membership.GetUser(CreateUserWizard1.UserName);

            //Construct the verification URL
            string verifyUrl = Request.Url.GetLeftPart(UriPartial.Authority) + Page.ResolveUrl("~/Verify.aspx?ID=" + userInfo.ProviderUserKey.ToString());

            //Replace <%VerifyUrl%> placeholder with verifyUrl value
            e.Message.Body = e.Message.Body.Replace("<%VerifyUrl%>", verifyUrl);
        }
    }
}

NewAccountTemplate.htm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Steps to activate your account...</title>
</head>
<body style="font-family:Verdana;">

    <h2>
        Welcome to My Website!</h2>
    <p>
        Hello, <%UserName%>. You are receiving this email because you recently created a new account at my 
        site. Before you can login, however, you need to first visit the following link:</p>
    <p>
        <a href="<%VerifyUrl%>"><%VerifyUrl%></a></p>
    <p>
        After visiting the above link you can log into the site!</p>
    <p>
        If you have any problems verifying your account, please reply to this email to 
        get assistance.</p>
    <p>
        Thanks!</p>

</body>
</html>

Verify.aspx.cs:

namespace WebSite
{
    public partial class Verify : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Make sure that a valid query string value was passed through
            if (string.IsNullOrEmpty(Request.QueryString["ID"]) || !Regex.IsMatch(Request.QueryString["ID"], "[0-9a-f]{8}\\-([0-9a-f]{4}\\-){3}[0-9a-f]{12}"))
            {
                InformationLabel.Text = "An invalid ID value was passed in through the querystring.";
            } else {
                //ID exists and is kosher, see if this user is already approved
                //Get the ID sent in the querystring
                Guid userId = new Guid(Request.QueryString["ID"]);

                //Get information about the user
                MembershipUser userInfo = Membership.GetUser(userId);
                if (userInfo == null) {
                    //Could not find user!
                    InformationLabel.Text = "The user account could not be found in the membership database.";
                } else {
                    //User is valid, approve them
                    userInfo.IsApproved = true;
                    Membership.UpdateUser(userInfo);

                    //Display a message
                    InformationLabel.Text = "Your account has been verified and you can now log into the site.";
                }
            }
        }
    }
}

Duas coisas sobre mim que é o que eu estou supondo não está fazendo com que ele funcione.

Como sabe mesmo enviar mensagem NewAccountTemplate.htm? UPDATE ahh eu vejo onde isso acontece no createuserwizard1 agora. Ainda recebendo essa mensagem de erro.Em NewAccountTemplate.htm recebo uma mensagem de aviso:

O aviso '<% VerifyUrl%>' não foi encontrado.

O que está errado? Estou com vista para algo.

ATUALIZAÇÃO 2:

Se eu adicionar onsendingmail = "CreateUserWizard1_SendingMail" Ele gera um link, no entanto, o link não funciona porque o usuário nunca é adicionado ao banco de dados que eu verifiquei isso. Então, quando eu clico no link no e-mail, ele diz que o pedido é ruim porque não há nenhum usuário com esse ID. Se eu remover essa linha de código, o usuário será criado, mas nenhum link será gerado: /

questionAnswers(1)

yourAnswerToTheQuestion