diff --git a/modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/SendMailClosure.java b/modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/SendMailClosure.java index 32840b8f5..946e11fc8 100644 --- a/modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/SendMailClosure.java +++ b/modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/SendMailClosure.java @@ -63,13 +63,16 @@ public void executeClosure() { TransportRunner.sendMessage(operationalConfig.getClusterKey(), session, message, message.getAllRecipients()); } } catch (final UnsupportedEncodingException e) { - LOGGER.error("Failed to send email:\n{}", email); + LOGGER.error("Failed to send email:\n{}", email.getId()); + LOGGER.trace("{}", email); throw new MailerException(MailerException.INVALID_ENCODING, e); } catch (final MessagingException e) { - LOGGER.error("Failed to send email:\n{}", email); + LOGGER.error("Failed to send email:\n{}", email.getId()); + LOGGER.trace("{}", email); throw new MailerException(MailerException.GENERIC_ERROR, e); } catch (final Exception e) { - LOGGER.error("Failed to send email:\n{}", email); + LOGGER.error("Failed to send email:\n{}", email.getId()); + LOGGER.trace("{}", email); throw e; } }