private int SendAnEmail(MessageContent emailMessage)
 {
     int result;
     try
     {                  
         VfsCustomerService.Business.SendTemplateEmailWithParam sendTemplateEmailWithParam = new SendTemplateEmailWithParam();                
         sendTemplateEmailWithParam.Send(emailMessage);
         result = (int)EmailCommandStatus.SuccessAndFinish;
     }
     catch (Exception ex)
     {
         SendEmailException sendEmailException = new SendEmailException(emailMessage, ex);
         listError.Add(sendEmailException);                
         result = (int)EmailCommandStatus.FailAndFinish;
     }
     return result;
 }
        private int SendAnEmail(MessageContent emailMessage)
        {
            int result;
            try
            {
               // EmailMessageService.EmailMessageWS emailMessageService = new EmailMessageService.EmailMessageWS();
                //emailMessageService.SendAnEmail(emailMessage);
                VfsCustomerService.Business.SendTemplateEmailWithParam sendTemplateEmailWithParam = new SendTemplateEmailWithParam();
                sendTemplateEmailWithParam.SmtpServer = "mail.vfs.com.vn";
                sendTemplateEmailWithParam.SmtpPort = 25;

                sendTemplateEmailWithParam.Send(emailMessage);
                
                result = (int)EmailCommandStatus.SuccessAndFinish;
            }
            catch (Exception ex)
            {
                SendEmailException sendEmailException = new SendEmailException(emailMessage, ex);
                listError.Add(sendEmailException);                
                result = (int)EmailCommandStatus.FailAndFinish;
            }
            return result;
        }
        public long SendAnSMS(MessageContent emailMessage)
        {
            long result = 0;
            try
            {
                if(emailMessage.BodyMessage.Length <= 160)
                {
                    VfsCustomerService.Business.SendSMS sendSMS = new SendSMS(this.userName, this.password);
                    result = sendSMS.Send(emailMessage);               
                }
                else
                {
                    VfsCustomerService.Business.SendSMS sendSMS;
                    string FirstMessage = Ultility.CutAddressHead(emailMessage.BodyMessage);
                    string SecondMessage = Ultility.CutAddressEnd(emailMessage.BodyMessage);
                    emailMessage.BodyMessage = FirstMessage;
                    sendSMS = new SendSMS(this.userName, this.password);
                    result = sendSMS.Send(emailMessage);

                    emailMessage.BodyMessage = SecondMessage;
                    sendSMS = new SendSMS(this.userName, this.password);
                    result = sendSMS.Send(emailMessage);    
                }
            }
            catch (Exception ex)
            {
                SendEmailException sendEmailException = new SendEmailException(emailMessage, ex);
                listError.Add(sendEmailException);                
            }
            return result;
        }