/**
* Send mail with ZIP-File to given mail address.
*/
private void sendMail(String zipFilename, String mail, long documentNumber) {
MailTools mt = new MailTools();
String from = OptionData.instance.getString(OptionData.EXPORT_MAIL);
String subject = OptionData.instance.getString(OptionData.EXPORT_TITLE).replace("#TITLE#", "" + documentNumber);
String password = OptionData.instance.getExportPassword(true);
String text = OptionData.instance.getString(OptionData.EXPORT_TEXT);
mt.setFrom(from);
mt.setPassword(password);
mt.setSubject(subject);
mt.setText(text);
mt.addTO(mail);
mt.addAttachment(zipFilename);
boolean sendMailError = false;
try {
if (!mt.sendMail()) {
sendMailError = true;
}
}
catch (Exception exc) {
sendMailError = true;