diff --git a/WHATSNEW b/WHATSNEW index aad6c2f64..ac34cb08b 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -274,6 +274,10 @@ Fixed bugs: work as TaskContainers at the same time. Bugzilla Report 41647. + * combining SSL and authentication in and MailLogger failed in + some setups. + Bugzilla Report 46063. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java b/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java index 931345281..60641b51f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java +++ b/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java @@ -247,7 +247,10 @@ public class MimeMailer extends Mailer { } msg.setContent(attachments); try { - Transport.send(msg); + // Send the message using SMTP, or SMTPS if the host uses SSL + Transport transport = sesh.getTransport(SSL ? "smtps" : "smtp"); + transport.connect(host, user, password); + transport.sendMessage(msg, msg.getAllRecipients()); } catch (SendFailedException sfe) { if (!shouldIgnoreInvalidRecipients()) { throw new BuildException(GENERIC_ERROR, sfe);