public void sendZoalMsg(string cust, string custName, string MobNo, string InvNo, string Amt, string Trans, string LR, string Bundles, string InDate) { try { DataTable rd = Other.IdvChetana_EmailSms(Convert.ToInt32(cust), "", "").Tables[0]; if (rd.Rows.Count > 0) { if (rd.Rows[0][0].ToString().ToLower() != "nocontact") { SMS_Client obj = new SMS_Client(); obj.MobileNo = rd.Rows[0][0].ToString(); if (custName.Length > 10) { custName = custName.Substring(0, 10); } obj.Msg = ConfigurationManager.AppSettings["SMS_ZONE"].ToString().Replace("@1", custName).Replace("@2", InvNo).Replace("@3", Amt).Replace("@4", Trans).Replace("@5", LR).Replace("@6", Bundles).Replace("@6", InDate); //"Invoice No: 1908.01 of amt 40000.00 has been generated on 09/08/2012.- Chetana publication"; obj.SendSMS(); } } } catch (Exception ex) { } }
public void sendMsg(string MobNo, string InvNo, string Amt, string Trans, string LR, string Bundles, string InDate) { try { if (MobNo.ToLower() != "nocontact") { SMS_Client obj = new SMS_Client(); obj.MobileNo = MobNo; //obj.MobileNo = "9987984488,9762514468"; obj.Msg = ConfigurationManager.AppSettings["SMS_INV"].ToString().Replace("@1", InvNo).Replace("@2", Amt).Replace("@3", Trans).Replace("@4", LR).Replace("@5", Bundles).Replace("@6", InDate); //"Invoice No: 1908.01 of amt 40000.00 has been generated on 09/08/2012.- Chetana publication"; HttpWebRequest request; HttpWebResponse response = null; Stream stream = null; request = (HttpWebRequest)WebRequest.Create("http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=CHETANAPUB&password=43425045&sendername=chetna&mobileno=" + obj.MobileNo + "&message=" + obj.Msg + ""); response = (HttpWebResponse)request.GetResponse(); stream = response.GetResponseStream(); StreamReader sr = new StreamReader(stream, System.Text.Encoding.Default); sHtml = sr.ReadToEnd(); //"Invoice No: 1908.01 of amt 40000.00 has been generated on 09/08/2012.- Chetana publication"; obj.SendSMS(); //obj.SendSMS(); } } catch (Exception ex) { } }
protected void GetHtmlStringA(string Phone, string DocNo, string AccountName, string Amount) { try { SMS_Client obj = new SMS_Client(); //obj.MobileNo = "9819259579"; obj.MobileNo = Phone; //obj.MobileNo = "9762514468"; //obj.MobileNo = "9987984488,9762514468"; // obj.Msg = ConfigurationManager.AppSettings["ackSMS"].ToString().Replace("@1", "").Replace("@2", "").Replace("@3", "") + "Rs" + Amount + "Credited in your a/c dated: " + docdate1 + " " + partyName + "-Chetana Book Depot"; if (txtCCDDNo.Text == "") { obj.Msg = ConfigurationManager.AppSettings["ackSMS"].ToString().Replace("@1", "").Replace("@2", "").Replace("@3", "") + "Dear Customer, Thank you for the Payment of Rs " + Amount + " Received aganist Receipet No. " + DocNo + " dated " + docdate1 + " Subject to Realisation of Cheque Chetana Book Depot"; } else { obj.Msg = ConfigurationManager.AppSettings["ackSMS"].ToString().Replace("@1", "").Replace("@2", "").Replace("@3", "") + "Dear Customer, Thank you for the Payment of Rs " + Amount + " Cheque No." + txtCCDDNo.Text + " Received aganist Receipet No. " + DocNo + " dated " + docdate1 + " Subject to Realisation of Cheque. Chetana Book Depot"; } //MessageBox(ConfigurationManager.AppSettings["BulkSmsusername"].ToString()); HttpWebRequest request; HttpWebResponse response = null; Stream stream = null; //MessageBox(ConfigurationManager.AppSettings["SMS_URL"]+"?username="******"SMS_USER"]+"&password="******"SMS_PWD"]+"&sendername="+ConfigurationManager.AppSettings["SMS_SNEDER"]+"&mobileno=" + obj.MobileNo + "&message=" + obj.Msg + ""); request = (HttpWebRequest)WebRequest.Create("" + ConfigurationManager.AppSettings["SMS_URL"] + "?username="******"SMS_USER"] + "&password="******"SMS_PWD"] + "&sendername=" + ConfigurationManager.AppSettings["SMS_SNEDER"] + "&mobileno=" + obj.MobileNo + "&message=" + obj.Msg + ""); response = (HttpWebResponse)request.GetResponse(); stream = response.GetResponseStream(); StreamReader sr = new StreamReader(stream, System.Text.Encoding.Default); sHtml = sr.ReadToEnd(); if (sHtml != "DND") { DataTable dt = new DataTable(); dt = Bank.UpdateIsSms(BnkCode, Convert.ToInt32(DocNo), strFY).Tables[0]; } if (sHtml == "DND") { sHtml = "SMS Not Sent, Number registered as DND."; } else if (sHtml == "Invalid mobile number.") { sHtml = "SMS Not Sent, Invalid mobile number."; } else if (sHtml == "*Your Validity Is Expired. Please Update Your Validity.") { sHtml = "SMS Not Sent, Your Validity Is Expired. Please Update Your Validity."; } MessageBox(sHtml); } catch (Exception ex) { MessageBox(ex.Message.ToString() + "SMS ERROR"); } }
public void sendMsg(string MobNo, string InvNo, string Amt, string Trans, string LR, string Bundles, string InDate) { try { if (MobNo.ToLower() != "nocontact") { SMS_Client obj = new SMS_Client(); obj.MobileNo = MobNo; obj.Msg = ConfigurationManager.AppSettings["SMS_INV"].ToString().Replace("@1", InvNo).Replace("@2", Amt).Replace("@3", Trans).Replace("@4", LR).Replace("@5", Bundles).Replace("@6", InDate); //"Invoice No: 1908.01 of amt 40000.00 has been generated on 09/08/2012.- Chetana publication"; obj.SendSMS(); } } catch (Exception ex) { } }