Esempio n. 1
0
        public void Send(Contact contact)
        {
            MailMessage mail = new MailMessage(
                contact.From,
                Settings.ContactToEmail,
                contact.Subject,
                contact.Message);

            new SmtpClient().Send(mail);
        }
Esempio n. 2
0
        public ActionResult Contact(ContactViewModel contactVM)
        {
            Initialise(AppConstants.HomeContact);

            if (!ModelState.IsValid) {
                return View(contactVM);
            }

            var contact = new Contact {
                From = contactVM.Afzender,
                Subject = "#HRE Contact form: " + contactVM.Onderwerp,
                Message = "Dit heeft de gebruiker ingevuld:<br/>" + contactVM.Bericht
            };

            new Email().Send(contact);

            return RedirectToAction("ContactConfirm");
        }