Package pt.opensoft.mail

Examples of pt.opensoft.mail.SimpleEmail


    this.mailsTo = mailsTo;
    this.sendMailWhenException = true;
  }

  private void warnExceptionByEmail(Throwable e) {
      SimpleEmail email = new SimpleEmail(this.mailSmtp);
      try {
            email.setFrom(this.mailFrom, getNameProcess());
        for (int i = 0; i < this.mailsTo.size(); i++) {
          email.addTo((String)mailsTo.get(i));
        }
        email.setSubject(getNameProcess() + " Exception: " + e.getMessage());
        StringBuffer message = new StringBuffer();
        message.append("Foi lan�ada uma excep��o pelo Processo ").append(getNameProcess()).append(" causando o fim da sua execu��o � seguinte data: ").append(new DateTime(new java.util.Date()).formatDateTime());
        message.append("\n\nStack Trace:\n");
        message.append("\t").append(StringUtil.toString(e));
            email.setMsg(message.toString());
            email.send();
        } catch (Exception mailException) {
            logger.warning("Error sending exception mail: " + mailException);
        }
  }
View Full Code Here


        setStatus(CANCELED);
        nextRunTime = null;
    }

    private void warnExceptionByEmail(Exception e) {
      SimpleEmail email = new SimpleEmail(this.mailSmtp);
      try {
            email.setFrom(this.mailFrom, getName());
        for (int i = 0; i < this.mailsTo.size(); i++) {
          email.addTo((String)mailsTo.get(i));
        }
        email.setSubject(getName() + " Exception: " + e.getMessage());
        StringBuffer message = new StringBuffer();
        message.append("Foi lan�ada uma excep��o pelo Daemon " + getName() + " causando o fim da sua execu��o � seguinte data: " + new DateTime(new java.util.Date()));
        message.append("\n\nStack Trace:\n");
        message.append("\t" + StringUtil.toString(e));
            email.setMsg(message.toString());
            email.send();
        } catch (Exception mailException) {
            logger.warning("Error sending exception mail: " + mailException);
        }
  }
View Full Code Here

TOP

Related Classes of pt.opensoft.mail.SimpleEmail

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.