FR [ 1868756 ] Enable smtp gmail support

This commit is contained in:
Carlos Ruiz 2008-01-10 18:21:30 +00:00
parent d1e133b072
commit d8beaf7fd7
1 changed files with 7 additions and 7 deletions

View File

@ -103,9 +103,9 @@ public final class EMail implements Serializable
/** Mail SMTP Server */ /** Mail SMTP Server */
private String m_smtpHost; private String m_smtpHost;
/** Mail SMTP Server Port */ /** Mail SMTP Server Port */
private int m_smtpPort = 0; // @Trifon // @TODO - make port configurable - private int m_smtpPort = 0;
/** SMTP enable start TLS */ /** SMTP enable start TLS */
private boolean m_smtpStarttlsEnable = false; // @Trifon // @TODO - make ttls configurable - private boolean m_smtpStarttlsEnable = false;
/** Attachments */ /** Attachments */
private ArrayList<Object> m_attachments; private ArrayList<Object> m_attachments;
/** UserName and Password */ /** UserName and Password */
@ -153,11 +153,11 @@ public final class EMail implements Serializable
{ {
if (m_auth != null) // createAuthenticator was called if (m_auth != null) // createAuthenticator was called
props.put("mail.smtp.auth", "true"); props.put("mail.smtp.auth", "true");
if (m_smtpPort > 0) { if (m_smtpHost.equalsIgnoreCase("smtp.gmail.com")) {
props.put("mail.smtp.port", "587"); // @Trifon TODO // TODO: make it configurable
} // Enable gmail port and ttls - Hardcoded
if (m_smtpStarttlsEnable) { props.put("mail.smtp.port", "587");
props.put("mail.smtp.starttls.enable", "true"); // @Trifon props.put("mail.smtp.starttls.enable", "true");
} }
session = Session.getInstance(props, m_auth); session = Session.getInstance(props, m_auth);