public ActionResult MailleriGonder(string Icerik) { string deger = "1"; if (Icerik != "") { var aboneListe = _unitOfWork.Abone.ToList(); string mailbody = "<table style='background-color:#fff;padding:10px;width:620px;text-align:left;border-top:10px solid #E3000F;border-bottom:10px solid #E3000F;border-left:10px solid #E3000F;border-right:10px solid #E3000F' width='630' cellspacing='0' cellpadding='0'><tbody><tr><td><table style='background-color:#ffffff;' width='100%' cellspacing='0' cellpadding = '0'> <tbody><tr><td style = 'padding: 10px;'><a href = 'https://www.becoming.com' target = '_blank' > <img src = 'https://www.becomingtur.com/Content/assest/images/logo.png' alt = '' width = '200' height = '68' border = '0' /></a></td><td style = 'color: #1a2640; font-family: Arial; font-size: 13px;margin-left:50px;' align = 'right' > (312) 435 96 16 <span style = 'color: #a5b9c5; font-size: 24px;' >|</span> <a style = 'text-decoration: none; color: #1a2640;' href = 'https://www.becoming.com/iletisim' target = '_blank' data - saferedirecturl = 'https://www.becoming.com/iletisim'> www.becomingtur.com </a> </td></tr><tr><td colspan = '2' ><hr style='border: 1px dashed black;'/> </td></tr><tr><td style = 'padding: 10px; font-size: 12px; font-family: Arial;' colspan = '2' >" + Icerik + "</td></tr><tr><td colspan = '2' ><img src = 'https://www.becoming.com/images/ustborder.png' alt = '' /></td></tr><tr><td style = 'padding: 10px; color: #808080; font-size: 12px;' colspan = '2'><p style = 'margin: 0 0 0 0; font-family: Arial;' > Copyright © 2021 Becomingtur.com Tüm hakları saklıdır.</p></td></tr></tbody></table></td></tr></tbody></table>"; foreach (var item in aboneListe) { var mail = item.EMail; Smtp.AboneMailGonder(mailbody, mail); } return(Json(deger)); } else { deger = "0"; return(Json(deger)); } }
public ActionResult AboneOl(string Email) { var deger = 0; if (Email.Contains("@") == true) { if (!_unitOfWork.Abone.Any(x => x.EMail == Email)) { Abone abone = new Abone { EMail = Email, AboneMi = true, CreatedDate = DateTime.Now }; _unitOfWork.Abone.Insert(abone); _unitOfWork.Save(); string mailbody = ""; mailbody += "Lütfen bu maili cevaplamayın <br/>"; mailbody += "Bültenden çıkmak için <a href=\"https://www.becomingtur.com/abone-cikis?source=" + abone.EMail + "\" target=\"_blank\">bu linke</a> tıklayın. <br/>"; Smtp.AboneMailGonder(mailbody, Email); deger = 1; //1 return(Json(deger)); } else { //0 return(Json(deger)); } } else { //2 deger = 2; return(Json(deger)); } }