mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 04:02:10 +01:00
Add error message if unable to generate img
This commit is contained in:
parent
f016d682c5
commit
b8a2240982
@ -82,14 +82,18 @@ public class SendMailSSL {
|
|||||||
// Generate an image ?
|
// Generate an image ?
|
||||||
File file = null;
|
File file = null;
|
||||||
if (Settings.generateImage) {
|
if (Settings.generateImage) {
|
||||||
ImageGenerator gen = new ImageGenerator(newPass);
|
try {
|
||||||
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
ImageGenerator gen = new ImageGenerator(newPass);
|
||||||
ImageIO.write(gen.generateImage(), "jpg", file);
|
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
||||||
messageBodyPart = new MimeBodyPart();
|
ImageIO.write(gen.generateImage(), "jpg", file);
|
||||||
DataSource source = new FileDataSource(file);
|
messageBodyPart = new MimeBodyPart();
|
||||||
messageBodyPart.setDataHandler(new DataHandler(source));
|
DataSource source = new FileDataSource(file);
|
||||||
messageBodyPart.setFileName(auth.getNickname() + "_new_pass.jpg");
|
messageBodyPart.setDataHandler(new DataHandler(source));
|
||||||
multipart.addBodyPart(messageBodyPart);
|
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);
|
message.setContent(multipart);
|
||||||
|
Loading…
Reference in New Issue
Block a user