protected void bntRegister_Click(object sender, EventArgs e) { string ActivationKey = KavsitWeb.CreateRandomPassword(7); string Domain = Request.Url.Authority; string MD5pass = KavsitWeb.CreateMD5Hash(pass.Text); Member m = new Member() { Name = name.Text, Surname = sur.Text, Email = mail.Text, UserName = user.Text, Password = MD5pass, ActivationKey = ActivationKey }; dcx.Members.InsertOnSubmit(m); dcx.SubmitChanges(); success.Visible = true; try { KavsitWeb.SendMail(mail.Text, KavsitWeb.Company("companyName") + " Aktivasyon Kodu", "<a href='http://" + Domain + "/Theme/Activation.aspx?key=" + ActivationKey + "'>Aktivasyon İçin Tıklayınız.<a>"); } catch (Exception ex) { lblerror.Text = ex.Message; } }
protected void btnSend_Click(object sender, EventArgs e) { string ad = txtAd.Text; string email = txtEmail.Text; string tel = txtTel.Text; string mesaj = txtMesaj.Text; try { Contact c = new Contact { Email = txtEmail.Text, Name = txtAd.Text, Message = txtMesaj.Text, Phone = txtTel.Text, Date = DateTime.Now, Summary = txtKonu.Text }; dcx.Contacts.InsertOnSubmit(c); dcx.SubmitChanges(); KavsitWeb.SendMail("*****@*****.**", "Blog İletişim Mesajı", "Gönderen Adı: " + ad + "<br />" + "Gönderen E-Posta: " + email + "<br />" + "Telefonu: " + tel + "<br />" + "Mesajı: " + mesaj + ""); success.Visible = true; } catch (Exception a) { error.Visible = true; Response.Write(a.Message); } }