Browse Source

Make <mail> work for SSL + authentication with javamail 1.4.1. PR 46063. Submitted by Craig Richardson

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@708217 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
491cd1e2d8
2 changed files with 8 additions and 1 deletions
  1. +4
    -0
      WHATSNEW
  2. +4
    -1
      src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java

+ 4
- 0
WHATSNEW View File

@@ -274,6 +274,10 @@ Fixed bugs:
work as TaskContainers at the same time.
Bugzilla Report 41647.

* combining SSL and authentication in <mail> and MailLogger failed in
some setups.
Bugzilla Report 46063.

Other changes:
--------------



+ 4
- 1
src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java View File

@@ -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);


Loading…
Cancel
Save