using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MyWebSite.Models;

namespace MyWebSite.Controllers
{
    public class ContactController : Controller
    {
        //
        // GET: /Contact/

        public ActionResult Index()
        {
            Contact model = new Contact();
            return View(model);
        }

        [HttpPost]
        public ActionResult Index(Contact model)
        {
            if (!ModelState.IsValid)
                return View(model);

            Email e = new Email();
            e.Send(model);

            return View("ContactSuccess");
        }

    }
}
