Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }