public static void sendSMS(SmsMsg Msg) { WebClient client = new WebClient(); // Add a user agent header in case the requested URI contains a query. client.QueryString.Add("user", "*****@*****.**"); client.QueryString.Add("password", "1rachelle"); client.QueryString.Add("api_id", "3422248"); client.QueryString.Add("from", Msg.From); client.QueryString.Add("to", Msg.DestinationNr); client.QueryString.Add("text", Msg.text); string baseurl = "http://api.clickatell.com/http/sendmsg"; Stream data = client.OpenRead(baseurl); StreamReader reader = new StreamReader(data); string s = reader.ReadToEnd(); data.Close(); reader.Close(); Debug.WriteLine(s); // http://api.clickatell.com/http/sendmsg?user=pieterf33%40gmail.com&password=PASSWORD&api_id=3422248&to=31683973700&text=Message }
public static void SendSms(Trade trade, SmsMsg Msg, bool AdminEmail) { _Msg = Msg; _SMSTrade = trade; _Admin = AdminEmail; BW = new BackgroundWorker(); BW.DoWork += new DoWorkEventHandler(BW_DoWork); BW.RunWorkerAsync(); }
void marketOrder_onOrderSend(object sender, MarketOrder.OrderSendEvent e) { if (e.Success) { EmailMsg msg = new EmailMsg(); msg.Title = "New Trade"; msg.Body = "an Order was generated and sucessfully send to the Market. \n" + e.Trade.ToString() + "go to " + @"http://www.alsitm.com/Trades.aspx" + " to view trade history\n" + @"http://www.alsitm.com/charts/Statssummary.html" + " to view profit summary chart\n" + @"http://www.alsitm.com/charts/TradeHistory.html" + " to view trade history chart\n" + @"http://www.alsitm.com/charts/TradeDifference.html" + " to view actual trade difference chart"; SmsMsg sms = new SmsMsg() { text="New Order", }; DoStuff.Email.SendEmail(e.Trade, msg, false); DoStuff.SMS.SendSms(e.Trade,sms , false); WebUpdate.SendOrder(e.Trade, false); WebUpdate.SendOrderToWebDB(e.Trade); } else { EmailMsg msg = new EmailMsg(); msg.Title = "Trade input Failed"; msg.Body = "an Order was generated but could not be send to Excel. \n" + e.Trade.ToString(); SmsMsg sms = new SmsMsg() { text = "Order Submission Failed", }; DoStuff.SMS.SendSms(e.Trade, sms, true); DoStuff.Email.SendEmail(e.Trade, msg, true); } }
void marketOrder_onOrderMatch(object sender, MarketOrder.OrderMatchEvent e) { EmailMsg msg = new EmailMsg(); msg.Title = "Order Matched"; msg.Body = e.Trade.ToString(); WebUpdate.SendOrder(e.Trade, true); SmsMsg sms = new SmsMsg() { text = "Order Matched", }; DoStuff.SMS.SendSms(e.Trade, sms, true); DoStuff.Email.SendEmail(e.Trade, msg, true); WebUpdate.SendOrderToWebDB(e.Trade); }