protected void btnregister_Click(object sender, EventArgs e) { try { string Name = GeneralFunc.ToProper(txtContcname.Text).Trim(); string Phone = txtphone.Text; string Email = txtemail.Text; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(CommonVariable.ContactUsEMail); msg.CC.Add(CommonVariable.ContactUsEMailCC); msg.Bcc.Add(CommonVariable.ArchieveMail); msg.Subject = "Regarding Contact request"; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendContactRequestDetails(Name, Phone, Email, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); mpealteruser.Show(); } catch (Exception ex) { } }
protected void btnSend_Click(object sender, EventArgs e) { try { foreach (GridViewRow gvr in grdESubInfo.Rows) { CheckBox chkIssue = (CheckBox)gvr.FindControl("chkIssue"); HiddenField hdnPreferenceID = (HiddenField)gvr.FindControl("hdnPreferenceID"); if (chkIssue.Checked == true) { DataSet dsgetDataByPreferenceID = objESubscriptionBL.GetDataByPreferenceID(hdnPreferenceID.Value); if (dsgetDataByPreferenceID.Tables[0].Rows.Count > 0) { for (int i = 0; i < dsgetDataByPreferenceID.Tables[0].Rows.Count; i++) { if (dsgetDataByPreferenceID.Tables[0].Rows[i]["Makeid"].ToString() != "0") { string EName = dsgetDataByPreferenceID.Tables[0].Rows[i]["Name"].ToString(); string EMake = dsgetDataByPreferenceID.Tables[0].Rows[i]["make"].ToString(); string EModel = dsgetDataByPreferenceID.Tables[0].Rows[i]["model"].ToString(); string EPrice = dsgetDataByPreferenceID.Tables[0].Rows[i]["PriceRange"].ToString(); DataSet dsPrefercars = objESubscriptionBL.GetCarSubscription_Ads(dsgetDataByPreferenceID.Tables[0].Rows[i]["Makeid"].ToString(), dsgetDataByPreferenceID.Tables[0].Rows[i]["ModelID"].ToString(), dsgetDataByPreferenceID.Tables[0].Rows[i]["PriceRange"].ToString()); DataTable dtPreferTable = dsPrefercars.Tables[0]; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(dsgetDataByPreferenceID.Tables[0].Rows[i]["Email"].ToString()); //msg.To.Add("*****@*****.**"); msg.Subject = "10 Used cars " + EMake.ToString() + " " + EModel.ToString(); msg.IsBodyHtml = true; string text = string.Empty; text = format.SendSubscriptionMail(ref text, dtPreferTable, EName, EMake, EModel, EPrice); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } } } } mpealteruser.Show(); lblErr.Visible = true; lblErr.Text = "Email(s) successfully send"; } } catch (Exception ex) { } }
protected void btnregister_Click(object sender, EventArgs e) { try { objDealersInfo.DealerName = GeneralFunc.ToProper(txtContcname.Text).Trim(); objDealersInfo.DealerPhone = txtphone.Text; objDealersInfo.DealerEmail = txtemail.Text; objDealersInfo.DealerAddress = txtRegAddress.Text; objDealersInfo.DealerCity = txtRegCity.Text; objDealersInfo.DealerShipName = txtDealerShipName.Text; objDealersInfo.DealerNotes = txtDealerNotes.Text; if (txtZip.Text.Length == 4) { objDealersInfo.DealerZip = "0" + txtZip.Text; } else { objDealersInfo.DealerZip = txtZip.Text; } DataSet dsDealerInfo = new DataSet(); dsDealerInfo = objNewCarsBL.USP_SaveDealerRequest(objDealersInfo); if (dsDealerInfo.Tables[0].Rows.Count > 0) { string DealerName = dsDealerInfo.Tables[0].Rows[0]["DealerName"].ToString(); string Phone = dsDealerInfo.Tables[0].Rows[0]["DealerPhone"].ToString(); string Email = dsDealerInfo.Tables[0].Rows[0]["DealerEmail"].ToString(); clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(CommonVariable.ContactUsEMail); msg.CC.Add(CommonVariable.ContactUsEMailCC); msg.Bcc.Add(CommonVariable.ArchieveMail ); msg.Subject = "Regarding Dealer request"; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendDealerRequestDetails(DealerName, Phone, Email, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } mpealteruser.Show(); } catch (Exception ex) { } }
private void SendIntromail(string Agentname, string Username) { try { clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(Username); //msg.Subject = "Thank You For Your Interest In United Car Exchange"; msg.IsBodyHtml = true; string text = string.Empty; string Language = string.Empty; if (ddlUserType.SelectedItem.Value == "2") { Language = "Eng(D)"; msg.Subject = "Thank You For Your Interest In United Car Exchange"; text = format.SendIntromaildetailsForDealers(Agentname, ref text); msg.Attachments.Add(new Attachment(Server.MapPath("~/MailTemplate/United Car Exchange - Dealership Compass Brochure v2.pdf"))); msg.From = new MailAddress("*****@*****.**"); } else { if (Convert.ToInt32(ddlLanguage.SelectedItem.Value) == 2) { Language = "Esp"; msg.Subject = "Gracias por su interés en United Car Exchange"; text = format.SendSpanishIntromaildetails(Agentname, ref text); } else { Language = "Eng"; msg.Subject = "Thank You For Your Interest In United Car Exchange"; text = format.SendIntromaildetails(Agentname, ref text); } } msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); bool bnew = objHotLeadBL.USP_SaveIntroMailDetails(Agentname, Username, Session[Constants.USER_ID].ToString(), Language); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
protected void rptrDownload_ItemCommand(object source, RepeaterCommandEventArgs e) { LinkButton lblIssuanceBatchID = (LinkButton)e.Item.FindControl("lblIssuanceBatchID"); LeadsDownloadBL obj = new LeadsDownloadBL(); clsMailFormats format = new clsMailFormats(); DataSet ds = obj.GetLeadsIssuedDetails(lblIssuanceBatchID.Text); //string text = string.Empty; //text = format.DownloadLeadInfoDetails(ref text, ds.Tables[0]); //lblMultiListMail.Visible = true; //lblMultiListMail.Text = text; //MpeListMail.Show(); DataSetToExcel.Convert(ds, Response, "LeadsHistory" + lblIssuanceBatchID.Text); }
protected void btnregister_Click(object sender, EventArgs e) { try { objNewCarsInfo.NewCarRequestName = GeneralFunc.ToProper(txtContactName.Text).Trim(); objNewCarsInfo.NewCarReqPhoneNumber = txtphone.Text; objNewCarsInfo.NewCarReqEmail = txtemail.Text; DataSet dsNewCarRequest = new DataSet(); dsNewCarRequest = objNewCarsBl.USP_SaveNewCarRequest(objNewCarsInfo); if (dsNewCarRequest.Tables[0].Rows.Count > 0) { string NewCarName = dsNewCarRequest.Tables[0].Rows[0]["NewCarRequestName"].ToString(); string Phone = dsNewCarRequest.Tables[0].Rows[0]["NewCarReqPhoneNumber"].ToString(); string Email = dsNewCarRequest.Tables[0].Rows[0]["NewCarReqEmail"].ToString(); clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(CommonVariable.ContactUsEMail); msg.CC.Add(CommonVariable.ContactUsEMailCC); msg.Subject = "Regarding new car request"; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendNewcarRequestDetails(NewCarName, Phone, Email, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } mpealteruser.Show(); } catch (Exception ex) { } }
public bool ReferFriend(string txtReferfrn) { MailMessage message = new MailMessage(); clsMailFormats objMail = new clsMailFormats(); message.From = new MailAddress(CommonVariable.FromInfoMail); message.To.Add(Convert.ToString(txtReferfrn.Trim())); message.Subject = "Welcome to United Car Exchange"; message.IsBodyHtml = true; string strMail = string.Empty; objMail.SendReferFriend(txtReferfrn.Trim(), ref strMail); message.Body = strMail.ToString(); SmtpClient smtp = new SmtpClient(); ////smtp.Host = "smtp.gmail.com"; ////smtp.Port = 587; ////smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); ////smtp.EnableSsl = true; ////smtp.Send(message); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(message); return true; }
protected void btnUpload_Click(object sender, EventArgs e) { //LeadsInfo objLeadsInfo=new LeadsInfo(); SmtpClient smtpClient = new SmtpClient(); MailMessage mymail = new MailMessage(); clsMailFormats objClsMailformat = new clsMailFormats(); DbTransaction Transaction = null; DbConnection Connection = null; try { SalesfilesUpload(Convert.ToInt32(ViewState["Count"]), ViewState["FileName"].ToString()); for (int index = 0; index < grdIntroInfo.Rows.Count; index++) { LeadsUploadExcel(index, ref Transaction, ref Connection); } if (Count > 0) { //string strSrc = Server.MapPath("SalesUpload\\" + ddlCampaigns.SelectedItem.Text + "\\"); ///Server.MapPath("SalesUpload\\" + ddlCampaigns.SelectedItem.Text + "\\" + FILENAME) System.IO.FileInfo dirInfo = new System.IO.FileInfo(Session["FileName"].ToString()); QCParameterBL objQCParameterBL = new QCParameterBL(); DataSet ds = objQCParameterBL.UpdateLeadsQcStatusUpdate(Session["FileId"].ToString()); //string filePath = strSrc; //string sAttach = filePath + Session["FileName"].ToString(); //mymail.Attachments.Add(new Attachment(sAttach)); //objFileType = (File_Type_Info)Session["Email_Sales"]; //if (objFileType.Email_To != "") //{ // mymail.To.Add(objFileType.Email_To); //} //MailAddress fromAddress = new MailAddress(Session[GenValidations.Email.ToString()].ToString()); //mymail.CC.Add(Session[GenValidations.Email.ToString()].ToString()); //mymail.Bcc.Add(objFileType.Email_bCc); //mymail.From = fromAddress; //mymail.Subject = Session["LocName"].ToString() + " " + ddlCampaigns.SelectedItem.Text + " " + txtFrom.Text + " Sales Uploaded On " + GenFunc.DateTimeFormat(System.DateTime.Now.ToString()); string s = string.Empty; string SalesMailFile = (Server.MapPath("MailFormats") + @"\Sale Upload Mail Body text.txt"); //objClsMailformat.sendSalesUpload(SalesMailFile,System.DateTime.Now.ToString(),ViewState["Count"].ToString(),txtFrom.Text.ToString(),txtTo.Text.ToString(),Session[GenValidations.USER_NAME].ToString(),ref s) //if (objClsMailformat.sendSalesUpload(SalesMailFile, System.DateTime.Now.ToString(), ViewState["Count"].ToString(), txtFrom.Text.ToString(), Session[GenValidations.USER_NAME].ToString(), ref s)) //{ // //Specify true if it is html message // mymail.IsBodyHtml = true; // mymail.Body = s.ToString(); // smtpClient.Host = "127.0.0.1"; // smtpClient.Port = 25; // smtpClient.Send(mymail); //} //System.IO.File.Delete(Session["SaveLoc"].ToString()); // Total records in the file: 2000 //Duplicates found: 200 //Records uploaded: 1800 //QC passed leads: 1600 //QC failed leads: 200 lblErrorMsg.Text = grdIntroInfo.Rows.Count + " Record Uploaded Successfully </br> " + ds.Tables[0].Rows[0][0].ToString() + " QC Passed <br/> " + (Convert.ToInt32(grdIntroInfo.Rows.Count) - Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString())) + " QC Failed"; btnSubmit.Enabled = true; btnUpload.Enabled = false; grdIntroInfo.DataSource = null; grdIntroInfo.DataBind(); } else { lblErrorMsg.Text = "There are no Rows to Upload"; } } catch (Exception ex) { Transaction.Rollback(); Connection.Close(); lblErrorMsg.Text = "Sales Uploaded, but Mail Could not be Found."; } finally { mymail.Dispose(); smtpClient = null; } }
protected void btnRefer_Click(object sender, EventArgs e) { MailMessage message = new MailMessage(); clsMailFormats objMail = new clsMailFormats(); message.From = new MailAddress(CommonVariable.FromInfoMail); message.To.Add(Convert.ToString(txtReferfrn.Text.Trim())); message.Subject = "Welcome to United Car Exchange"; message.IsBodyHtml = true; string strMail = string.Empty; objMail.SendReferFriend(txtReferfrn.Text.Trim(), ref strMail); message.Body = strMail.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(message); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(message); txtReferfrn.Text = ""; lblAlertMsg.Text = "Thank You For Referring!"; ; //mpealert.Show(); Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; cs.RegisterStartupScript(cstype, "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>"); txtReferfrn.Text = "Refer friend"; }
private void SendStatusChangeMail(string Status) { try { string UserEmail = Session[Constants.USER_NAME].ToString(); string UserDisName = Session[Constants.NAME].ToString(); clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(CommonVariable.FromInfoMail); msg.Bcc.Add(CommonVariable.ArchieveMail); msg.Subject = "Regarding customer requested to change status of Car ID# " + Session["CarID"].ToString(); msg.IsBodyHtml = true; string text = string.Empty; text = format.SendStatusChangeRequestMail(UserDisName, Status, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { throw ex; } }
private void SendOffermail(string Username) { try { clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); string FromEmail = txtFrom.Text.Trim(); string Subject = txtSubject.Text.Trim(); string strFlat80 = txtFirstText.Text.Trim(); string strFirstBody = txtSecondText.Text.Trim(); string strSecondBody = txtThirdText.Text.Trim(); string ClickNowText = txtClickNowText.Text.Trim(); msg.From = new MailAddress(FromEmail); msg.To.Add(Username); msg.Subject = Subject; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendOffermaildetails(ref text, strFlat80, strFirstBody, strSecondBody, ClickNowText); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); string FromMail = FromEmail; int UID = Convert.ToInt32(Session[Constants.USER_ID].ToString()); bool bnew = objSmartzIntroBL.SmartzSaveOfferMailDetails(UID, Username, FromMail); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
protected void zipValBut_Click(object sender, EventArgs e) { //string Name = GeneralFunc.ToProper(txtContcname.Text).Trim(); //string Phone = txtphone.Text; //string Email = txtemail.Text; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); if (Session["CustEmail"] != null) { if (Session["CustEmail"].ToString() != "") { msg.From = new MailAddress(txtcemail.Text); msg.To.Add(Session["CustEmail"].ToString()); msg.CC.Add("*****@*****.**"); msg.Bcc.Add(CommonVariable.ArchieveMail); msg.Subject = "Regarding Buyer requestbu"; msg.IsBodyHtml = true; string text = string.Empty; string Comments = string.Empty; if (txtComments.Text == "Enter your message here") { Comments = ""; } else { Comments = txtComments.Text; } text = format.SendContactSellar(lblSellerName.Text, zipCode1.Text, txtPhone.Text, txtcemail.Text, GeneralFunc.ToProper(txtfirstName.Text), txtlastName.Text, Comments, ref text, lblYear.Text, lblMake.Text, lblModel.Text, lblPrice.Text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); MpeEmail.Hide(); lblAlertMsg.Text = "Email request sent to seller."; mpealert.Show(); //Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>alert('');</script>"); Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>hide();</script>"); Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>"); BuyerTranBL objBuyerTranBL = new BuyerTranBL(); bool bSuccess = true; String strHostName = HttpContext.Current.Request.UserHostAddress.ToString(); string strIp = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString(); bSuccess = objBuyerTranBL.SaveBuyerRequest(txtcemail.Text, zipCode1.Text, txtPhone.Text, GeneralFunc.ToProper(txtfirstName.Text), txtlastName.Text, Comments, strIp, lblphone.Text, lblPrice.Text, hdnCarid.Value, "0"); zipCode1.Text = "Zip or City"; txtPhone.Text = "my phone number"; txtcemail.Text = "my email address"; txtfirstName.Text = "First Name"; txtlastName.Text = "Last Name"; txtComments.Text = "Enter your message here"; } else { Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>alert('Seller Email id doesnot exists');</script>"); } } }
protected void btnSendCustomMail_Click(object sender, EventArgs e) { try { Session.Timeout = 180; string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string LoginName = Session["RegUserName"].ToString(); string UserDisName = Session["RegName"].ToString(); clsMailFormats format = new clsMailFormats(); string text = string.Empty; lblGenMailTo.Text = LoginName; txtGenCCMail.Text = ""; txtGenSubject.Text = "Mail From United Car Exchange For Car ID# " + Session["ViewCarID"].ToString(); txtgenMailText.Text = ""; mdepgeneralMail.Show(); } catch (Exception ex) { throw ex; } }
protected void btnResendWelMail_Click(object sender, EventArgs e) { try { Session.Timeout = 180; string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string LoginName = Session["RegUserName"].ToString(); string UserDisName = Session["RegName"].ToString(); string Year = Session["ViewCarYear"].ToString(); string Model = Session["ViewCarModel"].ToString(); string Make = Session["ViewCarMake"].ToString(); string UniqueID = Session["CarViewUniqueID"].ToString(); string LoginUserID = Session["RegLoginUserID"].ToString(); Make = Make.Replace(" ", "%20"); Model = Model.Replace(" ", "%20"); Model = Model.Replace("&", "@"); string Link = "http://unitedcarexchange.com/Buy-Sell-UsedCar/" + Year + "-" + Make + "-" + Model + "-" + UniqueID; string TermsLink = "http://unitedcarexchange.com/TermsandConditions.aspx"; clsMailFormats format = new clsMailFormats(); string text = string.Empty; if (Session["ViewPayStatus"].ToString() == "5") { DateTime PostDate = Convert.ToDateTime(Session["ViewPDDate"].ToString()); PDDate = PostDate.ToString("MM/dd/yyyy"); text = format.SendRegistrationdetailsForPDSales(LoginUserID, LoginPassword, UserDisName, ref text, PDDate); } else { text = format.SendRegistrationdetails(LoginUserID, LoginPassword, UserDisName, ref text, Link, TermsLink); } lblRegisMail.Text = text; lblMailTo.Text = LoginName; txtEmailTo.Text = ""; lblRegisMail.Visible = true; mpeViewregisterMail.Show(); } catch (Exception ex) { throw ex; } }
private void ResendRegMail() { try { string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string UserEmail = Session["RegUserName"].ToString(); string LoginName = Session["RegUserLoginID"].ToString(); string UserDisName = Session["RegName"].ToString(); string Year = Session["SelYear"].ToString(); string Model = Session["SelModel"].ToString(); string Make = Session["SelMake"].ToString(); string UniqueID = Session["UniqueID"].ToString(); Make = Make.Replace(" ", "%20"); Model = Model.Replace(" ", "%20"); Model = Model.Replace("&", "@"); string Link = "http://unitedcarexchange.com/Buy-Sell-UsedCar/" + Year + "-" + Make + "-" + Model + "-" + UniqueID; string TermsLink = "http://unitedcarexchange.com/TermsandConditions.aspx"; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(UserEmail); if (txtEmailTo.Text != "") { msg.CC.Add(txtEmailTo.Text); } msg.Bcc.Add("*****@*****.**"); msg.Subject = "Registration Details From United Car Exchange For Car ID# " + Session["CarID"].ToString(); msg.IsBodyHtml = true; string text = string.Empty; if (Session["NewUserPayStatus"].ToString() == "5") { DateTime PostDate = Convert.ToDateTime(Session["NewUserPDDate"].ToString()); PDDate = PostDate.ToString("MM/dd/yyyy"); text = format.SendRegistrationdetailsForPDSales(LoginName, LoginPassword, UserDisName, ref text, PDDate); } else { text = format.SendRegistrationdetails(LoginName, LoginPassword, UserDisName, ref text, Link, TermsLink); } msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
private void SendIntromail1(string Agentname, string Username) { try { clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(Username); //msg.Subject = "Thank You For Your Interest In United Car Exchange"; msg.IsBodyHtml = true; string text = string.Empty; string Language = string.Empty; if (ddlUserType.SelectedItem.Value == "2") { Language = "Eng(D)"; msg.Subject = "Thank You For Your Interest In United Car Exchange"; text = format.SendIntromaildetailsForDealers(Agentname, ref text); msg.Attachments.Add(new Attachment(Server.MapPath("~/MailTemplate/United Car Exchange - Dealership Compass Brochure v2.pdf"))); msg.From = new MailAddress("*****@*****.**"); } else { if (Convert.ToInt32(ddlLanguage.SelectedItem.Value) == 2) { Language = "Esp"; msg.Subject = "Gracias por su interés en United Car Exchange"; text = format.SendSpanishIntromaildetails(Agentname, ref text); } else { Language = "Eng"; msg.Subject = "Thank You For Your Interest In United Car Exchange"; text = format.SendIntromaildetails(Agentname, ref text, ddlBrand.SelectedValue); } } msg.Body = text.ToString(); Session["PreviewMail"] = text.ToString(); } catch { } }
protected void btnSendPwd_Click(object sender, EventArgs e) { try { DataSet dsUserPwd = objUserregBL.USP_GetPasswordByID(txtForgetUserName.Text); if (dsUserPwd.Tables.Count > 0) { if (dsUserPwd.Tables[0].Rows.Count > 0) { clsMailFormats format = new clsMailFormats(); string LoginPassword = dsUserPwd.Tables[0].Rows[0]["Pwd"].ToString(); String LoginUserID = dsUserPwd.Tables[0].Rows[0]["UserID"].ToString(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(txtForgetUserName.Text); msg.Bcc.Add(CommonVariable.ArchieveMail); msg.Subject = "Forgot Password"; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendForgetPassword(LoginUserID, LoginPassword, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); mpeChangePW.Hide(); mpealteruser.Show(); lblErr.Visible = true; lblErr.Text = "Password send to your mail id"; } else { mpeChangePW.Hide(); mpealteruser.Show(); lblErr.Visible = true; lblErr.Text = "No user exists with " + txtForgetUserName.Text; } } else { mpeChangePW.Hide(); mpealteruser.Show(); lblErr.Visible = true; lblErr.Text = "No user exists with " + txtForgetUserName.Text; } } catch (Exception ex) { } }
protected void lnkbtnAuthorizationLetter_Click(object sender, EventArgs e) { try { DataSet dsDate = objdropdownBL.GetDatetime(); DateTime ToDayDate = Convert.ToDateTime(dsDate.Tables[0].Rows[0]["Datetime"].ToString()); if ((Session["CBClaimsCustID"] == null) || (Session["CBClaimsCustID"].ToString() == "")) { //mdepCBAlert.Show(); //lblCBAlertMsg.Visible = true; //lblCBAlertMsg.Text = "User information not available for this notice"; System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "sample();", true); clsMailFormats format = new clsMailFormats(); string text = string.Empty; string strPath2 = string.Empty; CCWordApp testNew = new CCWordApp(); string line = string.Empty; string strPath = string.Empty; string strPath1 = string.Empty; //DataSet dsInfo = objdropdownBL.GetPackageDetailsByUIDForAuthLetter(); strPath = HttpContext.Current.Server.MapPath("~/MailTemplate/") + "AuthorizeLetter.docx"; strPath2 = HttpContext.Current.Server.MapPath("~/NoticeCopies/" + Session["CBViewNoticeID"].ToString() + "/") + "AuthorizeLetter.doc"; testNew.Open(strPath); string str = testNew.GetContent(); string NewLine = string.Empty; line = str; if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", ""); } if (line.Contains("#VoiceFile#")) { line = line.Replace("#VoiceFile#", ""); } if (line.Contains("#Recorddate#")) { line = line.Replace("#Recorddate#", ""); } if (line.Contains("#AgentName#")) { line = line.Replace("#AgentName#", Session[Constants.NAME].ToString()); } if (line.Contains("#TodayDate#")) { line = line.Replace("#TodayDate#", ToDayDate.ToString("MM/dd/yyyy")); } if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", ""); } if (line.Contains("#Phone#")) { line = line.Replace("#Phone#", ""); } if (line.Contains("#Address#")) { line = line.Replace("#Address#", ""); } if (line.Contains("#VehiclesCount#")) { line = line.Replace("#VehiclesCount#", "0"); } if (line.Contains("#Amount#")) { line = line.Replace("#Amount#", "0.00"); } if (line.Contains("#Payment#")) { line = line.Replace("#Payment#", ""); } if (line.Contains("xxxxxxxxxxxx1015")) { line = line.Replace("xxxxxxxxxxxx1015", ""); } if (line.Contains("XX/XX")) { line = line.Replace("XX/XX", ""); } if (line.Contains("CVX")) { line = line.Replace("CVX", ""); } if (line.Contains("#CustEmail#")) { line = line.Replace("#CustEmail#", ""); } //address city, state zip testNew.Quit(); txtgenMailText.Text = line; mdepAuthorizeLetter.Show(); } else { Session.Timeout = 180; clsMailFormats format = new clsMailFormats(); string text = string.Empty; string strPath2 = string.Empty; CCWordApp testNew = new CCWordApp(); string line = string.Empty; string strPath = string.Empty; string strPath1 = string.Empty; //DataSet dsInfo = objdropdownBL.GetPackageDetailsByUIDForAuthLetter(); strPath = HttpContext.Current.Server.MapPath("~/MailTemplate/") + "AuthorizeLetter.docx"; strPath2 = HttpContext.Current.Server.MapPath("~/NoticeCopies/" + Session["CBViewNoticeID"].ToString() + "/") + "AuthorizeLetter.doc"; if (System.IO.File.Exists(strPath2)) { testNew.Open(strPath2); string str = testNew.GetContent(); string NewLine = string.Empty; line = str; testNew.Quit(); txtgenMailText.Text = line; } else { DataSet dsPackageInfo = objdropdownBL.GetPackageDetailsByUIDForAuthLetter(Convert.ToInt32(Session["CBClaimsCustID"].ToString())); if (dsPackageInfo.Tables.Count > 0) { if (dsPackageInfo.Tables[0].Rows.Count > 0) { testNew.Open(strPath); string str = testNew.GetContent(); string NewLine = string.Empty; line = str; string recordDate = string.Empty; if (dsPackageInfo.Tables[0].Rows[0]["PayDate"].ToString() != "") { DateTime dtRD = Convert.ToDateTime(dsPackageInfo.Tables[0].Rows[0]["PayDate"].ToString()); recordDate = dtRD.ToString("MM/dd/yyyy"); } else { recordDate = ""; } if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", dsPackageInfo.Tables[0].Rows[0]["Name"].ToString()); } if (line.Contains("#VoiceFile#")) { line = line.Replace("#VoiceFile#", dsPackageInfo.Tables[0].Rows[0]["VoiceRecord"].ToString()); } if (line.Contains("#Recorddate#")) { line = line.Replace("#Recorddate#", recordDate); } if (line.Contains("#AgentName#")) { line = line.Replace("#AgentName#", Session[Constants.NAME].ToString()); } if (line.Contains("#TodayDate#")) { line = line.Replace("#TodayDate#", ToDayDate.ToString("MM/dd/yyyy")); } if (line.Contains("#Phone#")) { line = line.Replace("#Phone#", dsPackageInfo.Tables[0].Rows[0]["phoneNumber"].ToString()); } string Address = dsPackageInfo.Tables[0].Rows[0]["Address"].ToString(); string City = dsPackageInfo.Tables[0].Rows[0]["City"].ToString(); string State = dsPackageInfo.Tables[0].Rows[0]["State_Code"].ToString(); string Zip = dsPackageInfo.Tables[0].Rows[0]["Zip"].ToString(); string FullAddress = string.Empty; FullAddress = Address; if (FullAddress != "") { FullAddress = FullAddress + " " + City; } else { FullAddress = City; } if (FullAddress != "") { FullAddress = FullAddress + ", " + State; } else { FullAddress = State; } if (FullAddress != "") { FullAddress = FullAddress + " " + Zip; } else { FullAddress = Zip; } if (line.Contains("#Address#")) { line = line.Replace("#Address#", FullAddress); } if (line.Contains("#VehiclesCount#")) { line = line.Replace("#VehiclesCount#", dsPackageInfo.Tables[1].Rows.Count.ToString()); } if (line.Contains("#Amount#")) { line = line.Replace("#Amount#", string.Format("{0:0.00}", Convert.ToDouble(dsPackageInfo.Tables[0].Rows[0]["Price"].ToString()))); } if (line.Contains("#Payment#")) { line = line.Replace("#Payment#", dsPackageInfo.Tables[0].Rows[0]["cardType"].ToString()); } string CardNum = dsPackageInfo.Tables[0].Rows[0]["cardNumber"].ToString(); if (CardNum.Length > 0) { CardNum = CardNum.Substring(Convert.ToInt32(CardNum.Length - 4), 4); CardNum = "xxxxxxxxxxxx" + CardNum.ToString(); } else { CardNum = "xxxxxxxxxxxxxxxx"; } if (line.Contains("xxxxxxxxxxxx1015")) { line = line.Replace("xxxxxxxxxxxx1015", CardNum); } string EXpDate = dsPackageInfo.Tables[0].Rows[0]["cardExpDt"].ToString(); string expirtdt = string.Empty; if (EXpDate != "") { string[] EXpDt = EXpDate.Split(new char[] { '/' }); expirtdt = EXpDt[0].ToString() + "/" + "20" + EXpDt[1].ToString(); } else { expirtdt = EXpDate; } if (line.Contains("XX/XX")) { line = line.Replace("XX/XX", expirtdt); } if (line.Contains("CVX")) { line = line.Replace("CVX", dsPackageInfo.Tables[0].Rows[0]["cardCode"].ToString()); } if (line.Contains("#CustEmail#")) { line = line.Replace("#CustEmail#", dsPackageInfo.Tables[0].Rows[0]["UserName"].ToString()); } //test.SaveAs(strPath2); testNew.Quit(); } else { testNew.Open(strPath); string str = testNew.GetContent(); string NewLine = string.Empty; line = str; if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", ""); } if (line.Contains("#VoiceFile#")) { line = line.Replace("#VoiceFile#", ""); } if (line.Contains("#Recorddate#")) { line = line.Replace("#Recorddate#", ""); } if (line.Contains("#AgentName#")) { line = line.Replace("#AgentName#", Session[Constants.NAME].ToString()); } if (line.Contains("#TodayDate#")) { line = line.Replace("#TodayDate#", ToDayDate.ToString("MM/dd/yyyy")); } if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", ""); } if (line.Contains("#Phone#")) { line = line.Replace("#Phone#", ""); } if (line.Contains("#Address#")) { line = line.Replace("#Address#", ""); } if (line.Contains("#VehiclesCount#")) { line = line.Replace("#VehiclesCount#", "0"); } if (line.Contains("#Amount#")) { line = line.Replace("#Amount#", "0.00"); } if (line.Contains("#Payment#")) { line = line.Replace("#Payment#", ""); } if (line.Contains("xxxxxxxxxxxx1015")) { line = line.Replace("xxxxxxxxxxxx1015", ""); } if (line.Contains("XX/XX")) { line = line.Replace("XX/XX", ""); } if (line.Contains("CVX")) { line = line.Replace("CVX", ""); } if (line.Contains("#CustEmail#")) { line = line.Replace("#CustEmail#", ""); } //address city, state zip testNew.Quit(); } } else { testNew.Open(strPath); string str = testNew.GetContent(); string NewLine = string.Empty; line = str; if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", ""); } if (line.Contains("#VoiceFile#")) { line = line.Replace("#VoiceFile#", ""); } if (line.Contains("#Recorddate#")) { line = line.Replace("#Recorddate#", ""); } if (line.Contains("#AgentName#")) { line = line.Replace("#AgentName#", Session[Constants.NAME].ToString()); } if (line.Contains("#TodayDate#")) { line = line.Replace("#TodayDate#", ToDayDate.ToString("MM/dd/yyyy")); } if (line.Contains("#CustName#")) { line = line.Replace("#CustName#", ""); } if (line.Contains("#Phone#")) { line = line.Replace("#Phone#", ""); } if (line.Contains("#Address#")) { line = line.Replace("#Address#", ""); } if (line.Contains("#VehiclesCount#")) { line = line.Replace("#VehiclesCount#", "0"); } if (line.Contains("#Amount#")) { line = line.Replace("#Amount#", "0.00"); } if (line.Contains("#Payment#")) { line = line.Replace("#Payment#", ""); } if (line.Contains("xxxxxxxxxxxx1015")) { line = line.Replace("xxxxxxxxxxxx1015", ""); } if (line.Contains("XX/XX")) { line = line.Replace("XX/XX", ""); } if (line.Contains("CVX")) { line = line.Replace("CVX", ""); } if (line.Contains("#CustEmail#")) { line = line.Replace("#CustEmail#", ""); } //address city, state zip testNew.Quit(); } //test = new CCWordApp(); //test.Open(strPath1); //test.InsertText(NewLine); //test.SaveAs(strPath2); //test.Quit(); txtgenMailText.Text = line; } mdepAuthorizeLetter.Show(); } } catch (Exception ex) { throw ex; } }
private void ResendRegMailMobi() { try { string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string LoginName = Session["RegUserName"].ToString(); string UserDisName = Session["RegName"].ToString(); string RegLogUserID = Session["RegLogUserID"].ToString(); string Year = Session["SelYear"].ToString(); string Model = Session["SelModel"].ToString(); string Make = Session["SelMake"].ToString(); string UniqueID = Session["UniqueID"].ToString(); Make = Make.Replace(" ", "%20"); Model = Model.Replace(" ", "%20"); Model = Model.Replace("&", "@"); string Link = "http://Mobicarz.com/Buy-Sell-UsedCar/" + Year + "-" + Make + "-" + Model + "-" + UniqueID; string TermsLink = "http://Mobicarz.com/TermsandConditions.aspx"; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(LoginName); //msg.Bcc.Add("*****@*****.**"); msg.Subject = "Registration Details From Mobicarz For Car ID# " + Session["CarID"].ToString(); msg.IsBodyHtml = true; string text = string.Empty; if (Session["NewUserPayStatus"].ToString() == "5") { DateTime PostDate = Convert.ToDateTime(Session["NewUserPDDate"].ToString()); PDDate = PostDate.ToString("MM/dd/yyyy"); text = format.SendRegistrationdetailsForPDSales(RegLogUserID, LoginPassword, UserDisName, ref text, PDDate, ddlBrand.SelectedValue); } else { text = format.SendRegistrationdetails(RegLogUserID, LoginPassword, UserDisName, ref text, Link, TermsLink, ddlBrand.SelectedValue); } msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { //throw ex; DataSet dsDatetime = objHotLeadBL.GetDatetime(); DateTime dtNow = Convert.ToDateTime(dsDatetime.Tables[0].Rows[0]["Datetime"].ToString()); int CarID = Convert.ToInt32(Session["CarID"].ToString()); int UID; string CenterCode = Session[Constants.CenterCode].ToString(); UID = 15; String UpdatedBy = Session[Constants.NAME].ToString(); string InternalNotesNew = "welcome email could not be sent from carsales"; string UpdateByWithDate = dtNow.ToString("MM/dd/yyyy hh:mm tt") + "-" + UpdatedBy + "<br>"; InternalNotesNew = UpdateByWithDate + InternalNotesNew.Trim() + "<br>" + "-------------------------------------------------"; DataSet dsNewIntNotes = objdropdownBL.USP_UpdateCustomerInternalNotes(CarID, InternalNotesNew, UID); Response.Redirect("EmailServerError.aspx"); } }
public string SubScribe(string PreferenceID, string sZip, string sName, string sEmail, string sPhoneNo) { Session[Constants.Subscribe] = 1; PreferencesBL objPreferencesBL = new PreferencesBL(); DataSet dssub = new DataSet(); PreferenceInfo ObjPreferncesInfo = new PreferenceInfo(); PreferncesItemsInfo ObjPreferncesItemsInfo = new PreferncesItemsInfo(); dssub = objPreferencesBL.GetEmailPreferencesbyEmail(sEmail); string sPreferenceID = string.Empty; if (dssub.Tables[0].Rows.Count == 0) { ObjPreferncesInfo.PreferenceID = PreferenceID; if (sZip != "Zip") { ObjPreferncesInfo.Zip = sZip; } if (sName != "Your Name") { ObjPreferncesInfo.Name = sName; } if (sEmail != "Your Email") { ObjPreferncesInfo.Email = sEmail; } if (sPhoneNo != "Your Phone") { ObjPreferncesInfo.Phone = sPhoneNo; } String strHostName = HttpContext.Current.Request.UserHostAddress.ToString(); ObjPreferncesInfo.IPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString(); if (HttpContext.Current.Request.Cookies["UserSettings"] == null) { HttpCookie myCookie = new HttpCookie("UserSettings"); myCookie.Expires = DateTime.Now.AddDays(500); myCookie.Values.Add("Email", ObjPreferncesInfo.Email); myCookie.Values.Add("Name", ObjPreferncesInfo.Name); myCookie.Values.Add("Phone", ObjPreferncesInfo.Phone); HttpContext.Current.Response.Cookies.Add(myCookie); } DataSet dsPreferences = new DataSet(); dsPreferences = objPreferencesBL.SaveSubscribe(ObjPreferncesInfo, 1); clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(sEmail); //msg.Bcc.Add("*****@*****.**"); msg.Subject = "Successfully modified your personalized weekly email alerts - United Car Exchange."; msg.IsBodyHtml = true; string text = string.Empty; string VerifyPreferences = string.Empty; string ModifyPreferences = string.Empty; string PreferencesID = string.Empty; //VerifyPreferences = "www.unitedcarexchange.com/VerifyPreferences.aspx?Preferce=" + dssub.Tables[0].Rows[0]["ID"].ToString(); //ModifyPreferences = "www.unitedcarexchange.com/EmailPreferences.aspx?Preferce=" + dssub.Tables[0].Rows[0]["ID"].ToString(); PreferencesID = dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(); text = format.SendEMailPreferencesEdit(dsPreferences.Tables[0].Rows[0]["Name"].ToString(), dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(), ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); return PreferencesID; } else { return "true"; } }
protected void btnSendListingDetails_Click(object sender, EventArgs e) { try { DataSet MultiSite = Session["ViewCarDetailsDataset"] as DataSet; DataTable dtMutisite = MultiSite.Tables[4]; if (dtMutisite.Rows.Count > 0) { clsMailFormats format = new clsMailFormats(); string text = string.Empty; string LoginName = Session["RegUserName"].ToString(); lblMultiSiteMailTo.Text = LoginName; string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string UserDisName = Session["RegName"].ToString(); string PackageName = Session["ViewPackageName"].ToString(); string UniqueID = Session["CarViewUniqueID"].ToString(); DataSet CarsDetails = (DataSet)Session["ViewCarDetailsDataset"]; string Carid = Session["ViewCarID"].ToString(); //text = format.SendMultiSitedetailsTesting(ref text, dtMutisite,CarsDetails); text = format.SendMultiListMail(ref text, dtMutisite, Carid, PackageName, UserDisName, UniqueID); //if (Session["ViewPayStatus"].ToString() == "5") //{ // DateTime PostDate = Convert.ToDateTime(Session["ViewPDDate"].ToString()); // PDDate = PostDate.ToString("MM/dd/yyyy"); // text = text; //} //else //{ // text = text; //} lblMultiListMail.Text = text; lblMailTo.Text = LoginName; txtMultiListEmailToCC.Text = ""; lblMultiListMail.Visible = true; MpeListMail.Show(); } else { mpealteruser.Show(); lblErr.Visible = true; lblErr.Text = "No active multisite listings are in place"; } } catch (Exception ex) { throw ex; } }
protected void btnSubscribe_Click(object sender, EventArgs e) { PreferencesBL objPreferencesBL = new PreferencesBL(); DataSet dssub = new DataSet(); PreferenceInfo ObjPreferncesInfo = new PreferenceInfo(); PreferncesItemsInfo ObjPreferncesItemsInfo = new PreferncesItemsInfo(); ObjPreferncesInfo.PreferenceID = hdnUserPrefernceID.Value; if (txtZip.Text != "Zip") { ObjPreferncesInfo.Zip = txtZip.Text; } if (txtName.Text != "Your Name") { ObjPreferncesInfo.Name = txtName.Text; } if (txtEmailAlert.Text != "Your Email") { ObjPreferncesInfo.Email = txtEmailAlert.Text; } if (txtPhoneNo.Text != "Your Phone") { ObjPreferncesInfo.Phone = txtPhoneNo.Text; } String strHostName = HttpContext.Current.Request.UserHostAddress.ToString(); ObjPreferncesInfo.IPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString(); DataSet dsPreferences = new DataSet(); dsPreferences = objPreferencesBL.SaveSubscribe(ObjPreferncesInfo, 1); for (int i = 1; i < 6; i++) { string SelectedMake = string.Empty; string SelectedModel = string.Empty; string SelectedRange = string.Empty; if (i == 1) { SelectedMake = ddlMakes1.SelectedValue; SelectedModel = ddlModels1.SelectedValue; SelectedRange = ddlRanges1.SelectedValue; } else if (i == 2) { SelectedMake = ddlMakes2.SelectedValue; SelectedModel = ddlModels2.SelectedValue; SelectedRange = ddlRanges2.SelectedValue; } else if (i == 3) { SelectedMake = ddlMakes3.SelectedValue; SelectedModel = ddlModels3.SelectedValue; SelectedRange = ddlRanges3.SelectedValue; } else if (i == 4) { SelectedMake = ddlMakes4.SelectedValue; SelectedModel = ddlModels4.SelectedValue; SelectedRange = ddlRanges4.SelectedValue; } else if (i == 5) { SelectedMake = ddlMakes5.SelectedValue; SelectedModel = ddlModels5.SelectedValue; SelectedRange = ddlRanges5.SelectedValue; } if (SelectedMake != "0" && SelectedModel != "0") { ObjPreferncesItemsInfo.Makeid = SelectedMake; ObjPreferncesItemsInfo.ModelID = SelectedModel; ObjPreferncesItemsInfo.PriceRange = SelectedRange; ObjPreferncesItemsInfo.UserPreferID = dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(); HiddenField hdnPreferenceID = (HiddenField)Page.FindControl("hdnPreferenceID" + i); ObjPreferncesItemsInfo.PreferenceID = hdnPreferenceID.Value; dssub = objPreferencesBL.SaveSubScribeItems(ObjPreferncesItemsInfo, true); } else { HiddenField hdnPreferenceID = (HiddenField)Page.FindControl("hdnPreferenceID" + i); if (hdnPreferenceID.Value != "") { if (SelectedMake != "0" && SelectedModel != "0") { ObjPreferncesItemsInfo.Makeid = SelectedMake; ObjPreferncesItemsInfo.ModelID = SelectedModel; ObjPreferncesItemsInfo.PriceRange = SelectedRange; ObjPreferncesItemsInfo.UserPreferID = dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(); ObjPreferncesItemsInfo.PreferenceID = hdnPreferenceID.Value; dssub = objPreferencesBL.SaveSubScribeItems(ObjPreferncesItemsInfo, false); } } } } clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(txtEmailAlert.Text); //msg.Bcc.Add("*****@*****.**"); msg.Subject = "Successfully modified your personalized weekly email alerts - United Car Exchange."; msg.IsBodyHtml = true; string text = string.Empty; string VerifyPreferences = string.Empty; string ModifyPreferences = string.Empty; string PreferencesID = string.Empty; //VerifyPreferences = "www.unitedcarexchange.com/VerifyPreferences.aspx?Preferce=" + dssub.Tables[0].Rows[0]["ID"].ToString(); //ModifyPreferences = "www.unitedcarexchange.com/EmailPreferences.aspx?Preferce=" + dssub.Tables[0].Rows[0]["ID"].ToString(); PreferencesID = dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(); text = format.SendEMailPreferencesEdit(dsPreferences.Tables[0].Rows[0]["Name"].ToString(), dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(), ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); lblalert.Text = "Your Preferences Has been Updated according to your selection"; mpealteruser.Show(); Page.ClientScript.RegisterStartupScript(typeof(Page), "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>"); }
protected void btnSendStatusMail_Click(object sender, EventArgs e) { try { DataSet MultiSite = Session["ViewCarDetailsDataset"] as DataSet; DataTable dtMutisite = MultiSite.Tables[4]; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add("*****@*****.**"); //msg.Bcc.Add("*****@*****.**"); msg.Subject = "MultiSite"; msg.IsBodyHtml = true; string text = string.Empty; // text = format.SendMultiSitedetailsTesting(ref text, dtMutisite); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "info*123*"); smtp.EnableSsl = true; smtp.Send(msg); } catch (Exception ex) { throw ex; } }
private void ResendMultiListingMail() { try { clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); string LoginName = Session["RegUserName"].ToString(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(LoginName); string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string UserDisName = Session["RegName"].ToString(); if (txtMultiListEmailToCC.Text != "") { msg.CC.Add(txtMultiListEmailToCC.Text); } msg.From = new MailAddress("*****@*****.**"); msg.Subject = "MultiSite"; msg.IsBodyHtml = true; string ToEmail = lblMultiSiteMailTo.Text; msg.To.Add(ToEmail); if (txtEmailTo.Text != "") { msg.CC.Add(txtEmailTo.Text); } msg.Bcc.Add("*****@*****.**"); msg.Subject = "Multisite Listing Details From United Car Exchange For Car ID# " + Session["ViewCarID"].ToString(); msg.IsBodyHtml = true; msg.Body = lblMultiListMail.Text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "info*123*"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
private void SendRegisterMail(string LoginName, string LoginPassword) { try { string UserDisName = Session["RegName"].ToString(); string UserLoginID = Session["RegLogUserID"].ToString(); clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(CommonVariable.FromInfoMail); msg.To.Add(LoginName); msg.Bcc.Add(CommonVariable.ArchieveMail ); msg.Subject = "Registration details from United Car Exchange"; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendRegistrationdetails(UserLoginID, LoginPassword, UserDisName, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { } }
private void SendGenMail() { try { string PDDate = string.Empty; string LoginPassword = Session["RegPassword"].ToString(); string LoginName = Session["RegUserName"].ToString(); string UserDisName = Session["RegName"].ToString(); clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); string ToEmail = lblGenMailTo.Text; msg.To.Add(ToEmail); if (txtGenCCMail.Text != "") { msg.CC.Add(txtGenCCMail.Text); } msg.Bcc.Add("*****@*****.**"); msg.Subject = txtGenSubject.Text; msg.IsBodyHtml = false; string text = string.Empty; text = txtgenMailText.Text; msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "info*123*"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
private void ResendRegMail() { try { string PDDate = string.Empty; string LoginPassword = Session["RegRVPassword"].ToString(); string LoginName = Session["RegRVUserName"].ToString(); string UserDisName = Session["RVRegName"].ToString(); string RvYear = Session["RvSelYear"].ToString(); string RvType = Session["RvSelType"].ToString(); string RvMake = Session["RvSelMake"].ToString(); string RvUniqueID = Session["RvUniqueID"].ToString(); RvType = RvType.Replace(" ", "%20"); RvMake = RvMake.Replace(" ", "%20"); string Link = "http://unitedrvexchange.com/Buy-Sell-UsedRVs/" + RvYear + "-" + RvType + "-" + RvMake + "-" + RvUniqueID; string TermsLink = "http://unitedrvexchange.com/TermsandConditions.aspx"; clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(LoginName); msg.Bcc.Add("*****@*****.**"); msg.Subject = "Registration Details From United Rv Exchange For RV ID# " + Session["RvCarID"].ToString(); msg.IsBodyHtml = true; string text = string.Empty; if (Session["NewUserPayStatus"].ToString() == "5") { DateTime PostDate = Convert.ToDateTime(Session["NewUserPDDate"].ToString()); PDDate = PostDate.ToString("MM/dd/yyyy"); text = format.SendRVRegistrationdetailsForPDSales(LoginName, LoginPassword, UserDisName, ref text, PDDate); } else { text = format.SendRVRegistrationdetails(LoginName, LoginPassword, UserDisName, ref text, Link, TermsLink); } msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "info*123*"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
private void SendIntromail(string Agentname, string Username) { try { clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress("*****@*****.**"); msg.To.Add(Username); msg.Subject = "Thank You For Your Interest In United Rv Exchange"; msg.IsBodyHtml = true; string text = string.Empty; text = format.SendRVIntromaildetails(Agentname, ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); //smtp.Host = "smtp.gmail.com"; //smtp.Port = 587; //smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); //smtp.EnableSsl = true; //smtp.Send(msg); smtp.Host = "127.0.0.1"; smtp.Port = 25; smtp.Send(msg); bool bnew = objSmartzIntroBL.RvsSaveIntroMailDetails(Agentname, Username); } catch (Exception ex) { //throw ex; Response.Redirect("EmailServerError.aspx"); } }
protected void btnSubscribe_Click(object sender, EventArgs e) { mpesubscribe.Hide(); PreferencesBL objPreferencesBL = new PreferencesBL(); DataSet dssub = new DataSet(); PreferenceInfo ObjPreferncesInfo = new PreferenceInfo(); PreferncesItemsInfo ObjPreferncesItemsInfo = new PreferncesItemsInfo(); ObjPreferncesInfo.PreferenceID = "0"; ObjPreferncesInfo.Zip = txtZip.Text; ObjPreferncesInfo.Name = txtName.Text; if (txtEmailAlert.Text != "Your Email") { ObjPreferncesInfo.Email = txtEmailAlert.Text; } if (txtPhoneNo.Text != "Your Phone") { ObjPreferncesInfo.Phone = txtPhoneNo.Text; } String strHostName = HttpContext.Current.Request.UserHostAddress.ToString(); ObjPreferncesInfo.IPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString(); if (Request.Cookies["UserSettings"] == null) { HttpCookie myCookie = new HttpCookie("UserSettings"); myCookie.Expires = DateTime.Now.AddDays(500); myCookie.Values.Add("Email", ObjPreferncesInfo.Email); myCookie.Values.Add("Name", ObjPreferncesInfo.Name); myCookie.Values.Add("Phone", ObjPreferncesInfo.Phone); Response.Cookies.Add(myCookie); } ObjPreferncesItemsInfo.Makeid = ddlMake1.SelectedValue; ObjPreferncesItemsInfo.ModelID = ddlModel1.SelectedValue; ObjPreferncesItemsInfo.PriceRange = ddlRange1.SelectedValue; DataSet dsEmailExist = new DataSet(); DataSet dsPreferences = new DataSet(); dsEmailExist = objPreferencesBL.GetEmailPreferencesbyEmail(txtEmailAlert.Text); if (dsEmailExist.Tables[0].Rows.Count == 0) { dsPreferences = objPreferencesBL.SaveSubscribe(ObjPreferncesInfo, 1); for (int i = 1; i < 6; i++) { string SelectedMake = string.Empty; string SelectedModel = string.Empty; string SelectedRange = string.Empty; if (i == 1) { SelectedMake = ddlMake1.SelectedValue; SelectedModel = ddlModel1.SelectedValue; SelectedRange = ddlRange1.SelectedValue; } else if (i == 2) { SelectedMake = ddlMake2.SelectedValue; SelectedModel = ddlModel2.SelectedValue; SelectedRange = ddlRange2.SelectedValue; } else if (i == 3) { SelectedMake = ddlMake3.SelectedValue; SelectedModel = ddlModel3.SelectedValue; SelectedRange = ddlRange3.SelectedValue; } else if (i == 4) { SelectedMake = ddlMake4.SelectedValue; SelectedModel = ddlModel4.SelectedValue; SelectedRange = ddlRange4.SelectedValue; } else if (i == 5) { SelectedMake = ddlMake5.SelectedValue; SelectedModel = ddlModel5.SelectedValue; SelectedRange = ddlRange5.SelectedValue; } if (SelectedMake != "0" && SelectedModel != "0") { ObjPreferncesItemsInfo.Makeid = SelectedMake; ObjPreferncesItemsInfo.ModelID = SelectedModel; ObjPreferncesItemsInfo.PreferenceID = "0"; ObjPreferncesItemsInfo.PriceRange = SelectedRange; ObjPreferncesItemsInfo.UserPreferID = dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(); dssub = objPreferencesBL.SaveSubScribeItems(ObjPreferncesItemsInfo, true); } } clsMailFormats format = new clsMailFormats(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(txtEmailAlert.Text); msg.To.Add("*****@*****.**"); //msg.Bcc.Add(); msg.Subject = "Welcome to your personalized weekly email alerts preferences."; msg.IsBodyHtml = true; string text = string.Empty; string VerifyPreferences = string.Empty; string ModifyPreferences = string.Empty; string PreferencesID = string.Empty; //VerifyPreferences = "www.unitedcarexchange.com/VerifyPreferences.aspx?Preferce=" + dssub.Tables[0].Rows[0]["ID"].ToString(); //ModifyPreferences = "www.unitedcarexchange.com/EmailPreferences.aspx?Preferce=" + dssub.Tables[0].Rows[0]["ID"].ToString(); PreferencesID = dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(); GeneralFunc obj = new GeneralFunc(); text = format.SendEMailPreferences(GeneralFunc.ToProper(dsPreferences.Tables[0].Rows[0]["Name"].ToString()), dsPreferences.Tables[0].Rows[0]["UserPreferID"].ToString(), ref text); msg.Body = text.ToString(); SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "hugomirad"); smtp.EnableSsl = true; smtp.Send(msg); //smtp.Host = "127.0.0.1"; //smtp.Port = 25; //smtp.Send(msg); // Progress111.Visible = false; Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; cs.RegisterStartupScript(cstype, "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>"); lblAlertMsg.Text = "Thank you for signing up for automatic email alerts.."; //mpealert.Show(); } else { Type cstype = GetType(); ClientScriptManager cs = Page.ClientScript; cs.RegisterStartupScript(cstype, "KyRST", "<script type='text/javascript' language='javascript'>pageLoad();</script>"); lblAlertMsg.Text = "Email ID Already Subscribed.."; //mpealert.Show(); } }