if(attachFiles != null) {
attachFiles = "," + attachFiles.replaceAll("\\s", "") + ",";
for(Entry<String, Object> entry : parameters.entrySet()) {
if(entry.getValue() instanceof File && attachFiles.indexOf("," + entry.getKey() + ",") > -1) {
File f = (File)entry.getValue();
m.addAttachment(f, entry.getKey() + "." + UtilMethods.getFileExtension(f.getName()));
}
}
}
if (m.sendMessage()) {