Try Dim user As MembershipUser = Membership.GetUser(CreateUserWizard1.UserName.ToString()) Dim userId As Guid = DirectCast(user.ProviderUserKey, Guid) Dim smtp As New SmtpClient() smtp.Host = "smtp.gmail.com" smtp.Port = 587 smtp.EnableSsl = True smtp.DeliveryMethod = SmtpDeliveryMethod.Network smtp.UseDefaultCredentials = False smtp.Credentials = New NetworkCredential("ahmad.bastas@gmail.com", "password") ' Set MailMessage fields. e.Message.IsBodyHtml = True e.Message.Subject = "Allo Magazine : Registration Confirmation Email" ' Replace placeholder text in message body with information ' provided by the user. e.Message.Body = e.Message.Body.Replace("<%AC%>", userId.ToString()) smtp.Send(e.Message) 'after all of this happens we take the querystring when user presses on activation link and then see if he is not approved we approve him Catch ex As Exception Response.Write(ex.Message) End Try
<MailDefinition Priority="High" BodyFileName="~/ConfirmationEmailHTML/ConfirmationEmail.htm" Subject="Allo Magazine : Registration Confirmation Email" From="ahmad.bastas@gmail.com"> </MailDefinition>
smtp.UseDefaultCredentials = False
smtp.UseDefaultCredentials = True
Dim SmtpClient As New Net.Mail.SmtpClient("smtp.gmail.com", 587 ) SmtpClient.EnableSsl = True 'now provide network credential smtp.Credentials = New NetworkCredential("ahmad.bastas@gmail.com", "password")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)