private void SendWelcomeEmail(tblaccess user) { var viewModel = new SignInConfirmEmailViewModel { User = user, }; var body = this.RenderViewToString(Views.ViewNames.WelcomeEmail, viewModel); var message = new MailMessage { Subject = "Tote To Toe Welcome Email", IsBodyHtml = true, Body = body }; message.To.Add(user.Email); using (var smtpClient = new SmtpClient()) { smtpClient.Send(message); } }
private void SendEmailVerification(tblaccess user) { var viewModel = new SignInConfirmEmailViewModel { User = user, }; var body = this.RenderViewToString(Views.ViewNames.ConfirmEmail, viewModel); var message = new MailMessage { Subject = "Tote To Toe Email Verification", IsBodyHtml = true, Body = body }; message.To.Add(user.Email); //ServicePointManager.ServerCertificateValidationCallback = // delegate(object s, X509Certificate certificate, // X509Chain chain, SslPolicyErrors sslPolicyErrors) // { return true; }; using (var smtpClient = new SmtpClient()) { smtpClient.Send(message); } }