Add error message if unable to generate img

This commit is contained in:
Gabriele C 2015-07-29 18:44:06 +02:00
parent f016d682c5
commit b8a2240982

View File

@ -82,6 +82,7 @@ public class SendMailSSL {
// Generate an image ?
File file = null;
if (Settings.generateImage) {
try {
ImageGenerator gen = new ImageGenerator(newPass);
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
ImageIO.write(gen.generateImage(), "jpg", file);
@ -90,6 +91,9 @@ public class SendMailSSL {
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(auth.getNickname() + "_new_pass.jpg");
multipart.addBodyPart(messageBodyPart);
} catch (Exception e) {
ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail);
}
}
message.setContent(multipart);