protected void Button1_Click(object sender, EventArgs e) { Email_Sender mail = new Email_Sender(); try { OneRecord aco = new OneRecord(); OneRecordDatum dmo = new OneRecordDatum(); DataTable dt; dmo.Type = "EmailSendFactor"; dt = aco.SelectOne(dmo); string title = dt.Rows[0]["title"].ToString(); string text = dt.Rows[0]["text"].ToString(); text = text.Replace("LinkFactor", "<a target='_blank' href='" + Request.RawUrl + "'>برای مشاهده فاکتور اینجا کلیک کنید </a>"); text = text.Replace("TextUser", TextBox3.Text); mail.Subject = title; mail.Body = text; dmo.Type = "EmailDisplay_Name"; dt = aco.SelectOne(dmo); mail.Display_Name = dt.Rows[0]["text"].ToString(); // "MMG SOFT Sales"; mail.From_Email_Address = TextBox2.Text; // "*****@*****.**"; mail.To_Email_Address = TextBox1.Text; mail.Port_Number = 25;// 465; dmo.Type = "EmailSmtp_Host"; dt = aco.SelectOne(dmo); mail.Smtp_Host = dt.Rows[0]["text"].ToString();// "mail.mmg-soft.com"; dmo.Type = "EmailSender_Email_Address"; dt = aco.SelectOne(dmo); mail.Sender_Email_Address = dt.Rows[0]["text"].ToString();//"*****@*****.**"; dmo.Type = "EmailSender_Email_Pass"; dt = aco.SelectOne(dmo); mail.Sender_Email_Pass = dt.Rows[0]["text"].ToString();// "mmg-softkarafarin"; mail.Send_Email_By_Host(); Label4.Visible = true; } catch { } }
public JsonResult Send_Email(string n_doc = "", string email = "", string other = "") { Ticket ti = Get_Ticket_Log_By_Id(n_doc); if (ti != null && ti.log != null) { Pdf_Creator k = new Pdf_Creator(); k.Create_Pdf_From_Ticket(ti); string msj = ti.client.contact; string encabezado = "Confirmación de servicio técnico POS, " + other; Email_Sender es = new Email_Sender(); es.Send_Email(email, msj, encabezado); } return(Json("")); }
protected void Button1_Click(object sender, EventArgs e) { Email_Sender mail = new Email_Sender(); dm.Email = TextBox1.Text.ToString(); string pass = ac.GetUserPass(dm).Rows.Count.ToString(); Button1.Enabled = false; Button2.Enabled = false; Label11.Visible = false; if (pass == "0") { Label11.Text = "ایمیل مورد نظر در فروشگاه ثبت نشده است.لطفا ایمیل را صحیح وارد کنید."; Label11.Visible = true; Button1.Enabled = true; Button2.Enabled = true; } else { try { OneRecord aco = new OneRecord(); OneRecordDatum dmo = new OneRecordDatum(); DataTable dt; dmo.Type = "EmailForgetPassword"; dt = aco.SelectOne(dmo); if (dt.Rows.Count > 0) { string title = dt.Rows[0]["title"].ToString(); string text = dt.Rows[0]["text"].ToString(); text = text.Replace("username", TextBox2.Text.ToString()); text = text.Replace("password", pass); mail.Subject = title; mail.Body = text; dmo.Type = "EmailDisplay_Name"; dt = aco.SelectOne(dmo); mail.Display_Name = dt.Rows[0]["text"].ToString();// "MMG SOFT Sales"; dmo.Type = "EmailFrom_Email_Address"; dt = aco.SelectOne(dmo); mail.From_Email_Address = dt.Rows[0]["text"].ToString();// "*****@*****.**"; mail.To_Email_Address = TextBox2.Text; mail.Port_Number = 25;// 465; dmo.Type = "EmailSmtp_Host"; dt = aco.SelectOne(dmo); mail.Smtp_Host = dt.Rows[0]["text"].ToString();// "mail.mmg-soft.com"; dmo.Type = "EmailSender_Email_Address"; dt = aco.SelectOne(dmo); mail.Sender_Email_Address = dt.Rows[0]["text"].ToString();//"*****@*****.**"; dmo.Type = "EmailSender_Email_Pass"; dt = aco.SelectOne(dmo); mail.Sender_Email_Pass = dt.Rows[0]["text"].ToString();// "mmg-softkarafarin"; mail.Port_Number = 25;// 465; mail.Send_Email_By_Host(); Label11.Text = "هم اکنون ایمیلی حاوی رمز عبور، برایتان ارسال شده است."; Label11.Visible = true; Button1.Enabled = true; Button2.Enabled = true; } } catch { Label11.Text = "ارسال رمز عبور با خطا مواجه شده است , لطفا دوباره تلاش کنید."; Label11.Visible = true; Button1.Enabled = true; Button2.Enabled = true; } } }
protected void Button1_Click(object sender, EventArgs e) { Email_Sender mail = new Email_Sender(); dm.Email = TextBox1.Text; if (ac.CheckUserExist(dm)) { Label18.Visible = true; } else { dm.Name = TextBox4.Text; dm.Family = TextBox5.Text; dm.Tell = TextBox6.Text; dm.Mobile = TextBox7.Text; dm.Post_Code = TextBox8.Text; dm.Country = TextBox9.Text; dm.Province = DropDownList1.Text; dm.City = TextBox10.Text; dm.Address = TextBox11.Text; dm.How_Find = DropDownList2.Text; dm.Recive_News = CheckBox1.Checked.ToString(); dm.Pass = TextBox2.Text; dm.Company = TextBox12.Text; Response.Cookies.Add(new HttpCookie("Id_User", ac.Insert(dm).ToString())); //<ارسال پیام خوشامد گویی برای کاربرهایی که جدید ثبت نام کرده اند> try { OneRecord aco = new OneRecord(); OneRecordDatum dmo = new OneRecordDatum(); DataTable dt; dmo.Type = "EmailRegisterUser"; dt = aco.SelectOne(dmo); if (dt.Rows.Count > 0) { string title = dt.Rows[0]["title"].ToString(); string text = dt.Rows[0]["text"].ToString(); text = text.Replace("username", TextBox1.Text.ToString()); text = text.Replace("name", TextBox4.Text.ToString() + " " + TextBox5.Text.ToString()); text = text.Replace("password", TextBox2.Text.ToString()); mail.Subject = title; mail.Body = text; dmo.Type = "EmailDisplay_Name"; dt = aco.SelectOne(dmo); mail.Display_Name = dt.Rows[0]["text"].ToString();// "MMG SOFT Sales"; dmo.Type = "EmailFrom_Email_Address"; dt = aco.SelectOne(dmo); mail.From_Email_Address = dt.Rows[0]["text"].ToString();// "*****@*****.**"; mail.To_Email_Address = TextBox1.Text; mail.Port_Number = 25;// 465; dmo.Type = "EmailSmtp_Host"; dt = aco.SelectOne(dmo); mail.Smtp_Host = dt.Rows[0]["text"].ToString();// "mail.mmg-soft.com"; dmo.Type = "EmailSender_Email_Address"; dt = aco.SelectOne(dmo); mail.Sender_Email_Address = dt.Rows[0]["text"].ToString();//"*****@*****.**"; dmo.Type = "EmailSender_Email_Pass"; dt = aco.SelectOne(dmo); mail.Sender_Email_Pass = dt.Rows[0]["text"].ToString();// "mmg-softkarafarin"; mail.Send_Email_By_Host(); } } catch { } Response.Cookies.Add(new HttpCookie("Family_User", TextBox4.Text + " " + TextBox5.Text)); Response.Cookies.Add(new HttpCookie("Email_User", TextBox1.Text)); Response.Cookies.Add(new HttpCookie("Login_User", "True")); if (Request.QueryString["Kind"] == null) { Response.Redirect("~/index.aspx?Type=UserRegisterOK"); } else { Response.Redirect("~/index.aspx?Type=ShopFactorRegister"); } } }