IDEMPIERE-2291 zk7 - send email broken

This commit is contained in:
Carlos Ruiz 2015-01-13 08:52:06 -05:00
parent c7151bb162
commit b4d9087303
1 changed files with 7 additions and 1 deletions

View File

@ -354,7 +354,13 @@ public final class EMail implements Serializable
t.connect();
// t.connect(m_smtpHost, user, password);
// log.fine("transport connected");
Transport.send(m_msg);
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(javax.mail.Session.class.getClassLoader());
Transport.send(m_msg);
} finally {
Thread.currentThread().setContextClassLoader(tcl);
}
// t.sendMessage(msg, msg.getAllRecipients());
if (log.isLoggable(Level.FINE)) log.fine("Success - MessageID=" + m_msg.getMessageID());
}