parent
2c9cb6d99a
commit
8c6db4a2c9
@ -46,8 +46,7 @@ public class SendMailSSL {
|
|||||||
try {
|
try {
|
||||||
email = initializeMail(auth, settings);
|
email = initializeMail(auth, settings);
|
||||||
} catch (EmailException e) {
|
} catch (EmailException e) {
|
||||||
ConsoleLogger.showError("Failed to create email with the given settings: "
|
ConsoleLogger.logException("Failed to create email with the given settings:", e);
|
||||||
+ StringUtils.formatException(e));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,8 +58,8 @@ public class SendMailSSL {
|
|||||||
file = generateImage(auth, plugin, newPass);
|
file = generateImage(auth, plugin, newPass);
|
||||||
content = embedImageIntoEmailContent(file, email, content);
|
content = embedImageIntoEmailContent(file, email, content);
|
||||||
} catch (IOException | EmailException e) {
|
} catch (IOException | EmailException e) {
|
||||||
ConsoleLogger.showError("Unable to send new password as image for email " + auth.getEmail()
|
ConsoleLogger.logException(
|
||||||
+ ": " + StringUtils.formatException(e));
|
"Unable to send new password as image for email " + auth.getEmail() + ":", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,15 +113,14 @@ public class SendMailSSL {
|
|||||||
email.setHtmlMsg(content);
|
email.setHtmlMsg(content);
|
||||||
email.setTextMsg(content);
|
email.setTextMsg(content);
|
||||||
} catch (EmailException e) {
|
} catch (EmailException e) {
|
||||||
ConsoleLogger.showError("Your email.html config contains an error and cannot be sent: "
|
ConsoleLogger.logException("Your email.html config contains an error and cannot be sent:", e);
|
||||||
+ StringUtils.formatException(e));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
email.send();
|
email.send();
|
||||||
return true;
|
return true;
|
||||||
} catch (EmailException e) {
|
} catch (EmailException e) {
|
||||||
ConsoleLogger.showError("Failed to send a mail to " + email.getToAddresses() + ": " + e.getMessage());
|
ConsoleLogger.logException("Failed to send a mail to " + email.getToAddresses() + ":", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user