diff --git a/org.adempiere.base/src/org/compiere/util/EMail.java b/org.adempiere.base/src/org/compiere/util/EMail.java index 6edd35727e..ab10af53b4 100644 --- a/org.adempiere.base/src/org/compiere/util/EMail.java +++ b/org.adempiere.base/src/org/compiere/util/EMail.java @@ -68,7 +68,7 @@ import com.sun.mail.smtp.SMTPMessage; public final class EMail implements Serializable { /** - * + * */ private static final long serialVersionUID = -2526338392563042117L; //use in server bean @@ -81,12 +81,12 @@ public final class EMail implements Serializable * @param subject Subject of message * @param message The message */ - public EMail (MClient client, String from, String to, + public EMail (MClient client, String from, String to, String subject, String message) { this (client.getCtx(), client.getSMTPHost(), from, to, subject, message); } // EMail - + /** * Full Constructor * @param client the client @@ -96,7 +96,7 @@ public final class EMail implements Serializable * @param message The message * @param html */ - public EMail (MClient client, String from, String to, + public EMail (MClient client, String from, String to, String subject, String message, boolean html) { this (client.getCtx(), client.getSMTPHost(), from, to, subject, message, html); @@ -111,12 +111,12 @@ public final class EMail implements Serializable * @param subject Subject of message * @param message The message */ - public EMail (Properties ctx, String smtpHost, String from, String to, - String subject, String message) + public EMail (Properties ctx, String smtpHost, String from, String to, + String subject, String message) { this(ctx, smtpHost, from, to, subject, message, false); } - + /** * Full Constructor * @param ctx context @@ -127,7 +127,7 @@ public final class EMail implements Serializable * @param message The message * @param html html email */ - public EMail (Properties ctx, String smtpHost, String from, String to, + public EMail (Properties ctx, String smtpHost, String from, String to, String subject, String message, boolean html) { setSmtpHost(smtpHost); @@ -209,9 +209,9 @@ public final class EMail implements Serializable props.put("mail.store.protocol", "smtp"); props.put("mail.transport.protocol", "smtp"); props.put("mail.host", m_smtpHost); - //Timeout for sending the email defaulted to 20 seconds - props.put("mail.smtp.timeout", 20000); - + //Timeout for sending the email defaulted to 20 seconds + props.put("mail.smtp.timeout", 20000); + if (CLogMgt.isLevelFinest()) props.put("mail.debug", "true"); // @@ -226,7 +226,7 @@ public final class EMail implements Serializable props.put("mail.smtp.port", "587"); props.put("mail.smtp.starttls.enable", "true"); } - + session = Session.getInstance(props, m_auth); session.setDebug(CLogMgt.isLevelFinest()); } @@ -331,7 +331,7 @@ public final class EMail implements Serializable { sb.append(" - Invalid Username/Password - " + m_auth); } - else // other MessagingException + else // other MessagingException { String msg = ex.getLocalizedMessage(); if (msg == null) @@ -360,7 +360,7 @@ public final class EMail implements Serializable ex = ((MessagingException)ex).getNextException(); else ex = null; - } + } while (ex != null); // error loop // if (CLogMgt.isLevelFinest()) @@ -391,7 +391,7 @@ public final class EMail implements Serializable { return m_sentMsg; } // getSentMsg - + /** * Was sending the Msg OK * @return msg == OK @@ -400,7 +400,7 @@ public final class EMail implements Serializable { return m_sentMsg != null && SENT_OK.equals(m_sentMsg); } // isSentOK - + /** * Dump Message Info */ @@ -664,7 +664,7 @@ public final class EMail implements Serializable return m_replyTo; } // getReplyTo - + /************************************************************************** * Set Subject * @param newSubject Subject @@ -757,16 +757,15 @@ public final class EMail implements Serializable { m_subject = subject; StringBuffer sb = new StringBuffer("\n") - .append("
\n") - .append("