[NonAction] public void SendVerificationLinkEmail(string emailID, string activationCode) { var verifyUrl = "/User/VerifyAccount/" + activationCode; var link = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, verifyUrl); var fromEmail = new MailAddress("<hidden>", "Jyoti Looks Good"); var toEmail = new MailAddress(emailID); var fromEmailPassword = "********"; // Replace with actual password string subject = "Your account is successfully created!"; string body = "We are excited to tell you that your Dotnet Awesome account is" + " successfully created. Please click on the below link to verify your account" +"<a href="" + link + "">" + link + "</a> "; var smtp = new SmtpClient() { Host = "smtp.gmail.com", Port = 587, EnableSsl = true, DeliveryMethod = SmtpDeliveryMethod.Network, UseDefaultCredentials = false, Credentials = new NetworkCredential(fromEmail.Address, fromEmailPassword) }; using (var message = new MailMessage(fromEmail, toEmail) { Subject = subject, Body = body, IsBodyHtml = true }); smtp.Send(message); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)