コード例 #1
0
ファイル: HomeController.cs プロジェクト: vashisht/Ninja
 public ActionResult Partners(EmailDetails emailDetails)
 {
     return View();
 }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: vashisht/Ninja
        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");
        }