Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }              
        }