Ejemplo n.º 1
0
 public ActionResult Iletisim(iletisimModel model)
 {
     if (ModelState.IsValid)
     {
         var body = new StringBuilder();
         body.AppendLine("İsim: " + model.Name);
         body.AppendLine("Mail: " + model.Email);
         body.AppendLine("Konu: " + model.Konu);
         body.AppendLine("Mesaj: " + model.Aciklama);
         Email.SendMail(body.ToString());
         ViewBag.Success = true;
     }
     return(View());
 }
Ejemplo n.º 2
0
        public ActionResult Index(iletisimModel model)
        {
            if (ModelState.IsValid)
            {
                var body = new StringBuilder();
                body.AppendLine("Rumuz: " + model.NickName);
                body.AppendLine("İsim: " + model.FullName);
                body.AppendLine("Tel: " + model.Phone);
                body.AppendLine("Eposta: " + model.Email);
                body.AppendLine("Konu: " + model.Message);
                Gmail.SendMail(body.ToString());
                ViewBag.Success = true;
            }



            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult Iletisim(iletisimModel model)
        {
            var duyuruListe = db.Duyurular.OrderByDescending(c => c.tarih).ToList().Take(3);

            try
            {
                Mesaj alinan_mesaj = new Mesaj();
                alinan_mesaj.ad     = model.ad;
                alinan_mesaj.soyad  = model.soyad;
                alinan_mesaj.mail   = model.mail;
                alinan_mesaj.konu   = model.konu;
                alinan_mesaj.mesaj1 = model.mesaj;
                alinan_mesaj.tarih  = DateTime.Now;
                db.Mesaj.Add(alinan_mesaj);
                db.SaveChanges();
                TempData["sonuc"] = "Kayıt Başarılı Şekilde Yapıldı";
            }
            catch
            {
                TempData["sonuc"] = "Bir Hata Oluştu";
            }
            return(View(duyuruListe));
        }
Ejemplo n.º 4
0
 // POST api/<controller>
 public string Post(iletisimModel value)
 {
     return(islem.MesajGonder(value));
 }