public bool SendEmail(string from, string to, string cc, string bcc, string subject, string body) { try { var middlewareService = new MiddlewareService.MiddlewareServicePortTypeClient(); string response = middlewareService.doService(_username, _password, FormatEmail(from, to, cc, bcc, subject, body)); if (response == "<SENT />") { return(true); } Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(response)); return(false); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(false); } }
public bool SendEmail(string from, string to, string cc, string bcc, string subject, string body) { try { var middlewareService = new MiddlewareService.MiddlewareServicePortTypeClient(); string response = middlewareService.doService(_username, _password, FormatEmail(from, to, cc, bcc, subject, body)); if (response == "<SENT />") { return true; } Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(response)); return false; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return false; } }
public bool SendSMS(string to, string content) { try { var middlewareService = new MiddlewareService.MiddlewareServicePortTypeClient(); //string asdf = middlewareService.healthCheck(); string response = middlewareService.doSMS(_username, _password, content, to); if (response.Contains("<STATUS>OK</STATUS>")) { return true; //"<SENT><SEND_STATUS><+971528785483><STATUS>OK</STATUS></+971528785483></SEND_STATUS></SENT>" } Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(response)); return false; } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return false; } }
public bool SendSMS(string to, string content) { try { var middlewareService = new MiddlewareService.MiddlewareServicePortTypeClient(); //string asdf = middlewareService.healthCheck(); string response = middlewareService.doSMS(_username, _password, content, to); if (response.Contains("<STATUS>OK</STATUS>")) { return(true); //"<SENT><SEND_STATUS><+971528785483><STATUS>OK</STATUS></+971528785483></SEND_STATUS></SENT>" } Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(response)); return(false); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); return(false); } }