Display a message on bad email.html

This commit is contained in:
Xephi 2015-12-09 10:38:41 +01:00
parent 9233fbfb04
commit dcd06760ce

View File

@ -2,6 +2,8 @@ package fr.xephi.authme;
import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail; import org.apache.commons.mail.HtmlEmail;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -81,8 +83,14 @@ public class SendMailSSL {
ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail); ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail);
} }
} }
try {
email.setHtmlMsg(content); email.setHtmlMsg(content);
email.setTextMsg(content); email.setTextMsg(content);
} catch (EmailException e)
{
ConsoleLogger.showError("Your email.html config contains some error and cannot be send!");
return;
}
try { try {
email.send(); email.send();
} catch (Exception e) { } catch (Exception e) {