More error messages!

This commit is contained in:
Gabriele C 2015-07-30 00:47:19 +02:00
parent 949ebc03bb
commit 7bfab781a1

View File

@ -96,15 +96,26 @@ public class SendMailSSL {
} }
} }
message.setContent(multipart);
Transport transport = session.getTransport("smtp"); Transport transport = session.getTransport("smtp");
message.setContent(multipart);
try {
transport.connect(smtp, acc, password); transport.connect(smtp, acc, password);
} catch (Exception e) {
ConsoleLogger.showError("Can't connect to your SMTP server! Aborting! Can't send recorvery email to " + mail);
if (file != null)
file.delete();
return;
}
transport.sendMessage(message, message.getAllRecipients()); transport.sendMessage(message, message.getAllRecipients());
if (file != null) if (file != null)
file.delete(); file.delete();
} catch (RuntimeException e) {
ConsoleLogger.showError("Some error occured while trying to send a email to " + mail);
} catch (Exception e) { } catch (Exception e) {
ConsoleLogger.showError("Some error occured while trying to send a mail to " + mail); ConsoleLogger.showError("Some error occured while trying to send a email to " + mail);
} }
} }