public class MailManagerImpl extends Object implements MailManager
Constructor and Description |
---|
MailManagerImpl(PropertyManager propertyManager,
InitialContext initialContext,
I18nHelper i18nHelper) |
Modifier and Type | Method and Description |
---|---|
protected SMTPServer |
getSmtpServer() |
boolean |
isConfigured() |
void |
sendHtmlEmail(javax.mail.internet.InternetAddress emailAddress,
String subject,
String body,
String plainText)
Sends an HTML email using the configured mail server (remote host / JNDI).
|
void |
sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress,
String subject,
String body)
Sends an email using the configured mail server (remote host / JNDI).
|
public MailManagerImpl(PropertyManager propertyManager, InitialContext initialContext, I18nHelper i18nHelper)
public void sendHtmlEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, String plainText) throws MailSendException
MailManager
sendHtmlEmail
in interface MailManager
emailAddress
- address of recipient.subject
- subject header.
Will be appended with the configured mail subject prefix in the final email.body
- email body html.plainText
- plainText alternative to the html body text specified in body
MailSendException
- an error occured sending the email.public void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body) throws MailSendException
MailManager
sendPlainTextEmail
in interface MailManager
emailAddress
- address of recipient.subject
- subject header.
Will be appended with the configured mail subject prefix in the final email.body
- email body text.MailSendException
- an error occured sending the email.protected SMTPServer getSmtpServer() throws MailSendException
MailSendException
public boolean isConfigured()
isConfigured
in interface MailManager
true
if the mail server is fully configured (does not check if the configuration is correct)Copyright © 2016 Atlassian. All rights reserved.