public interface MailManager extends MailConfigurationService
Modifier and Type | Method and Description |
---|---|
MailConfiguration |
getMailConfiguration()
Deprecated.
Use
instead |
boolean |
isConfigured()
Deprecated.
Use
instead |
void |
saveConfiguration(MailConfiguration mailServerEntity)
Deprecated.
Use
instead |
Collection<? extends EmailMessage> |
sendEmails(Collection<? extends EmailMessage> messagesToSend)
Sends multiple emails using the configured mail server.
|
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).
|
void |
sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress,
String subject,
String body,
Map<String,String> headers,
Map<String,DataSource> attachments)
Sends an email with zero or more attachments and headers using the configured mail server (remote host / JNDI).
|
SendTestMailResult |
sendTestMail(SMTPServer smtpServer,
javax.mail.internet.InternetAddress emailAddress)
Send a test email using the supplied mail server (remote host / JNDI)
|
List<ValidationError> |
validateConfiguration(MailConfiguration mailConfiguration)
Verifies whether the specified MailConfiguration is valid
|
void sendHtmlEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, String plainText) throws MailSendException
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.void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body) throws MailSendException
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.void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, Map<String,String> headers, Map<String,DataSource> attachments) throws MailSendException
emailAddress
- address of recipient.subject
- subject header.
Will be appended with the configured mail subject prefix in the final email.body
- email body text.headers
- custom headers to add.attachments
- [displayed filename]->[data] mapping for attachments.MailSendException
- an error occured sending the email.SendTestMailResult sendTestMail(SMTPServer smtpServer, javax.mail.internet.InternetAddress emailAddress) throws MailSendException
smtpServer
- supplied SMTP Server, which will be used to send message.emailAddress
- address of recipient.MailSendException
- an error occured sending the email.Collection<? extends EmailMessage> sendEmails(Collection<? extends EmailMessage> messagesToSend) throws MailSendException
MailSendException
- an error occurred that prevented sending any email (connection error, configuration error, etc.).List<ValidationError> validateConfiguration(MailConfiguration mailConfiguration)
mailConfiguration
- entity with attributes to be validated@Deprecated void saveConfiguration(MailConfiguration mailServerEntity)
instead
saveConfiguration
in interface MailConfigurationService
mailServerEntity
- new configuration@Deprecated MailConfiguration getMailConfiguration()
instead
getMailConfiguration
in interface MailConfigurationService
PropertyManagerException
- property does no exist@Deprecated boolean isConfigured()
instead
isConfigured
in interface MailConfigurationService
true
if the mail server is fully configured (does not check if the configuration is correct)Copyright © 2020 Atlassian. All rights reserved.