Author: b007 | Posted on: 9/28/2009 2:38:09 PM | Views : 476

Hi,
I just added the Event of SendingMail in CreateUserWizard for sending an activation Email.
What I did in SendingMail Event code:
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e) { 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); SmtpClient smtp = new SmtpClient(); smtp.EnableSsl = true; smtp.Send(e.Message); e.Cancel = true; } The last 4 rows is for sending ...

Go to the complete details ...