protected void btnSend_Click(object sender, EventArgs e) { objUser = new tblUser(); objUser.Where.AppUserName .Value = txtUserName.Text; objUser.Query.Load(); if (objUser.RowCount > 0) { clsCommon objCommon = new clsCommon(); clsEncryption objEncrypt = new clsEncryption(); string StrBody = ""; string strSubject = "Password Recovery Request"; StrBody = objCommon.readFile(Server.MapPath("~/admin/EmailTemplates/ForgetPassword.html")); StrBody = StrBody.Replace("`email`", objUser.AppEmail); StrBody = StrBody.Replace("`password`", objEncrypt.Decrypt(objUser.AppPassword, appFunctions.strKey.ToString())); objCommon.SendMail(objUser.AppEmail, strSubject, StrBody); objEncrypt = null; objCommon = null; txtUserName.Text = ""; lblMsg.Text = "Your password has been sent to your email address. Please check your email."; lblMsg.ForeColor = System.Drawing.Color.Green; } else { lblMsg.Text = "Invalid Your User Name."; lblMsg.ForeColor = System.Drawing.Color.Red; } objUser = null; }
public bool Save() { tblInquiry objInquiry = new tblInquiry(); objInquiry.AddNew(); objInquiry.s_AppName = txtName.Text; objInquiry.s_AppEmail = txtEmail.Text; objInquiry.s_AppMobile = txtMobile.Text; objInquiry.s_AppMessage = txtMessage.Text; objInquiry.s_AppProductDetailID = hdnProductDetailId.Value; objInquiry.Save(); objInquiry = null; clsCommon objCommon = new clsCommon(); string StrBody = ""; string strSubject = "Inquiry"; StrBody = objCommon.readFile(Server.MapPath("~/EmailTemplates/Inquiry.html")); StrBody = StrBody.Replace("`name`", txtName.Text); StrBody = StrBody.Replace("`mobileno`", txtMobile.Text); StrBody = StrBody.Replace("`email`", txtEmail.Text); StrBody = StrBody.Replace("`message`", txtMessage.Text); objCommon.SendMail("", strSubject, StrBody); objCommon = null; return(true); }
private void SendMail(int strStatus, string strOrderID) { string strEmail = ""; try { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Fabymart.com order "; Strbody = objCommon.readFile(Server.MapPath("~/Admin/EmailTemplates/OrderConfirmation.html")); if (strStatus == Convert.ToInt32(Convert.ToInt32(Enums.Enum_ReturnStatus.Approved))) { Strbody = Strbody.Replace("`orderstatus`", "Return Approved"); strSubject += " Return Approved - "; } else if (strStatus == Convert.ToInt32(Enums.Enum_ReturnStatus.Reject)) { Strbody = Strbody.Replace("`orderstatus`", "Return Rejected By FabyMart"); strSubject += " Return Rejected - "; } Strbody = Strbody.Replace("`shipmentdate`", ""); Strbody = Strbody.Replace("`link`", strServerURL); Strbody = Strbody.Replace("`orderdate`", DateTime.Now.Date.ToString("dd-MM-yyyy")); tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderID))) { strEmail = objOrder.AppRecevierEmail; Strbody = Strbody.Replace("`uname`", objOrder.AppReceiverName); Strbody = Strbody.Replace("`orderno`", objOrder.s_AppOrderNo); strSubject += objOrder.s_AppOrderNo; } objOrder = null; objCommon.SendMail(strEmail, strSubject, Strbody); // objCommon.SendConfirmationMail(strEmail, strSubject, Strbody, Enums.Enum_Confirmation_Mail_type.order); strEmail = ""; objCommon = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }
public void SendMail(string strId) { try { objCommon = new clsCommon(); string Strbody = ""; string strSubject = "Subscription Detail"; Strbody = objCommon.readFile(Server.MapPath("~/EmailTemplates/NewsLetterSubscriber.html")); Strbody = Strbody.Replace("`username`", txtUserEmail.Text.Trim()); objEncrypt = new clsEncryption(); Strbody = Strbody.Replace("`Link`", PageBase.GetServerURL() + "/Approved.aspx?CID=" + objEncrypt.Encrypt(strId, appFunctions.strKey)); objEncrypt = null; objCommon.SendMail(txtUserEmail.Text, strSubject, Strbody); objCommon = null; } catch (Exception ex) { Response.Write(ex.StackTrace.ToString()); } }