Skip to content
Snippets Groups Projects
Commit 1ebf88b1 authored by juanf's avatar juanf
Browse files

SSDM-238 : Support SMTP ports other than 25 and other parameters.

SVN: 31542
parent 3e31fe23
No related branches found
No related tags found
No related merge requests found
...@@ -79,9 +79,27 @@ public final class MailClient extends Authenticator implements IMailClient ...@@ -79,9 +79,27 @@ public final class MailClient extends Authenticator implements IMailClient
public MailClient(final String from, final String smtpHost) public MailClient(final String from, final String smtpHost)
{ {
this(from, smtpHost, null, null, null, null);
}
public MailClient(
final String from,
final String smtpHost,
final String smtpPort,
final String smtpUsername,
final String smtpPassword,
final String testAddress)
{
assert from != null;
assert smtpHost != null;
properties = new Properties(); properties = new Properties();
properties.put(JavaMailProperties.MAIL_FROM, from); properties.put(JavaMailProperties.MAIL_FROM, from);
properties.put(JavaMailProperties.MAIL_SMTP_HOST, smtpHost); properties.put(JavaMailProperties.MAIL_SMTP_HOST, smtpHost);
properties.put(JavaMailProperties.MAIL_SMTP_PORT, smtpPort);
properties.put(JavaMailProperties.MAIL_SMTP_USER, smtpUsername);
properties.put(MailClient.MAIL_SMTP_PASSWORD, smtpPassword);
properties.put(MailClient.MAIL_TEST_ADDRESS, testAddress);
init(); init();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment