Collection<File> sources = getSourceFiles();
data.addItem(Keys.SOURCE_FILES, sources);
MessageData messageData = dialog.getMessageData();
data.addItem(Keys.MESSAGE_DATA, messageData);
// Create command.
SendEmail sendEmail = new SendEmail();
try {
sendEmail.perform(data);
} catch (Exception exception) {
exception.printStackTrace();
JOptionPane.showMessageDialog(
dialog,
"Сообщение не было отправлено.",