diff --git a/WHATSNEW b/WHATSNEW index c0bf7ddaa..66bf5963b 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -161,6 +161,8 @@ Fixed bugs: * > 1 ssh invocations to a given host would fail. Bugzilla report 36207. +* EmailTask was eating SMTP error messages. Bugzilla report 37547. + Other changes: -------------- * New task converts a path into a property diff --git a/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java b/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java index c17855705..c5971481a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java @@ -529,12 +529,13 @@ public class EmailTask extends Task { log("Sent email with " + count + " attachment" + (count == 1 ? "" : "s"), Project.MSG_INFO); } catch (BuildException e) { - log("Failed to send email", Project.MSG_WARN); + Throwable t = e.getCause() == null ? e : e.getCause(); + log("Failed to send email: " + t.getMessage(), Project.MSG_WARN); if (failOnError) { throw e; } } catch (Exception e) { - log("Failed to send email", Project.MSG_WARN); + log("Failed to send email: " + e.getMessage(), Project.MSG_WARN); if (failOnError) { throw new BuildException(e); }