Example #1
0
 public ActionResult Partners(EmailDetails emailDetails)
 {
     return View();
 }
Example #2
0
        public ActionResult Contato(EmailDetails emailDetails)
        {
            if (!ModelState.IsValid)
            {
                PopulateSubjects();
                return View();
            }

            //MailMessage mailMessage = new MailMessage();
            //mailMessage.From =   emailDetails.EmailAddress;
            //mailMessage.To = "*****@*****.**";
            //mailMessage.Subject = emailDetails.SelectedSubject;
            //mailMessage.Body =emailDetails.Message;
            //SendEmail(mailMessage);

            MailMessage message = new MailMessage();
            message.To.Add(emailDetails.EmailAddress );
            message.IsBodyHtml = true;
            message.Subject = emailDetails.SelectedSubject;
            message.Body = emailDetails.Message;
            System.Net.Mail.SmtpClient smtp = new SmtpClient();
            smtp.Send(message);

            return RedirectToAction("Index");
        }