} catch (IOException e) {
throw new SysException(e);
}
try {
MailSender ms = new MailSender();
ms.setInitProperty("mail.smtp.host", mi.smtphost);
ms.setInitProperty("mail.smtp.port", mi.smtpport);
ms.setInitProperty("mail.smtp.user", mi.smtpuser);
ms.setInitProperty("mail.smtp.pwd", mi.smtppwd);
ms.init();
ta.writeLogToFile(id_task, x, "UTF-8");
if (mi.to != null)
ms.setStepProperty("recipient", mi.to);
if (mi.bcc != null)
ms.setStepProperty("h_recipient", mi.bcc);
if (mi.sender != null)
ms.setStepProperty("sender", mi.sender);
if (mi.subject != null)
ms.setStepProperty("subject", mi.subject);
if (mi.body != null)
ms.setStepProperty("body", mi.body);
ms.setStepProperty("files", new File[] { x });
ms.setStepProperty("descriptions", new String[] { "log.utf-8.doc" });
ms.setStepProperty("filenames", new String[] { "log.utf-8.doc" });
ms.exec();
} finally {
Process.freeTempFile(x);
}
}
}