예제 #1
0
        protected bool SendEmail(string indirizzoEmail, string oggetto, ControllerContext controller, string nomeView, object datiEmail)
        {
            EmailModel email = new EmailModel(controller);

            email.To.Add(new System.Net.Mail.MailAddress(indirizzoEmail));
            email.Subject   = oggetto + " - " + System.Web.Configuration.WebConfigurationManager.AppSettings["nomeSito"];
            email.Body      = nomeView;
            email.DatiEmail = datiEmail;
            EmailController emailer = new EmailController();

            return(emailer.SendEmail(email));
        }
        public ActionResult ReinvioEmailRegistrazione()
        {
            // invio email registrazione
            EmailModel   email  = new EmailModel(ControllerContext);
            PersonaModel utente = Session["utente"] as PersonaModel;

            email.To.Add(new System.Net.Mail.MailAddress(utente.Email.SingleOrDefault(e => e.TIPO == (int)TipoEmail.Registrazione).EMAIL));
            email.Subject   = Email.RegistrationSubject + " - " + WebConfigurationManager.AppSettings["nomeSito"];
            email.Body      = "RegistrazioneUtenteReinvio";
            email.DatiEmail = utente;
            EmailController emailer = new EmailController();

            return(Json(emailer.SendEmail(email), JsonRequestBehavior.AllowGet));
        }