Ejemplo n.º 1
0
  public void sendMail() {
    if ((true == mailOrNot) && (!"".equals(mailList)) && (0 != buffer.size())) {
      if (logger.isInfoEnabled()) {
        logger.info("卡库不平分析线程发送邮件给联系人:" + contactName);
      }
      String tmpStr = "";
      if (buffer.size() > 5000) {
        tmpStr = buffer.getString(0, 5000);
      }
      tmpStr = buffer.toString();

      String[] tempList = null;
      String[] nameList = null;
      tempList = mailList.split(";");
      nameList = mailName.split(";");
      for (int i = 0; i < tempList.length; i++) {
        if (!"".equals(tempList)) {
          CommonSendMailUtil.sendMail(
              GetApplicationResources.getInstance()
                  .getString("com.kingstar.MonitorSys.SUBJECT_SERIAL"),
              contactName,
              tempList[i],
              StringUtil.wholeMailGenerate(
                  nameList[i],
                  DateUtil.reFormatTime(recordTime),
                  mailRecord,
                  tmpStr,
                  "UNBALANCE_ERROR"));
        }
      }
    }
  }