public ActionResult NovoUsuario(Usuarios pUser) { if (UsuariosRepositorio.VerificaEmail(pUser.email)) { Usuarios pUserTratado = UsuariosUtil.ToLowerUsuario(pUser); Usuarios pUserMail = UsuariosUtil.ToFirstUpper(pUserTratado); int id = UsuariosRepositorio.Create(pUserTratado); if (ModelState.IsValid) { MailMessage mail = new MailMessage(); mail.To.Add(pUser.email); mail.From = new MailAddress("*****@*****.**", "ON SABA"); mail.Subject = "Confirmação cadastro ON SABA"; string Body = "<img src=\"http://saofrancisco.azurewebsites.net/Content/Imagens/onsaba.png\" height=\"65\"> <br /> <h3>Obrigado por inscrever-se no ON SABA " + pUserMail.nome + "</h3> <br /> <p>Ative sua conta no link abaixo e aproveite!</p> <br /> <a href=http://saofrancisco.azurewebsites.net/Usuarios/ConfirmacaoEmail?pIdUser="******"> << Ative aqui >> </a>"; mail.Body = Body; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential ("*****@*****.**", "onsaba2014");// Enter seders User name and password smtp.EnableSsl = true; smtp.Send(mail); ViewBag.sucesso = "Para finalizar o cadastro, confirme a conta no email informado."; var userId = User.Identity.Name; Usuarios UsuarioLogado = UsuariosRepositorio.GetUserId(userId); return(View("Conta", UsuarioLogado)); } else { return(View()); } } else { ViewBag.aviso = "Email já existente, tente outro."; return(View("NovoUsuario")); } }