Package com.atlassian.crowd.manager.mail
Interface MailManager
- All Superinterfaces:
MailConfigurationService
- All Known Implementing Classes:
MailManagerImpl
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.boolean
Deprecated.Useinstead
void
saveConfiguration
(MailConfiguration mailServerEntity) Deprecated.Useinstead
void
sendEmail
(EmailMessage messageToSend) Sends a single email using the configured mail serverCollection<? 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) Deprecated.since 4.4.0, UsesendEmail(com.atlassian.crowd.manager.mail.EmailMessage)
insteadvoid
sendPlainTextEmail
(javax.mail.internet.InternetAddress emailAddress, String subject, String body) Deprecated.since 4.4.0, UsesendEmail(com.atlassian.crowd.manager.mail.EmailMessage)
insteadvoid
sendPlainTextEmail
(javax.mail.internet.InternetAddress emailAddress, String subject, String body, Map<String, String> headers, Map<String, javax.activation.DataSource> attachments) Deprecated.since 4.4.0, UsesendEmail(com.atlassian.crowd.manager.mail.EmailMessage)
insteadsendTestMail
(SMTPServer smtpServer, javax.mail.internet.InternetAddress emailAddress) Send a test email using the supplied mail server (remote host / JNDI)validateConfiguration
(MailConfiguration mailConfiguration) Verifies whether the specified MailConfiguration is valid
-
Method Details
-
sendHtmlEmail
@Deprecated void sendHtmlEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, String plainText) throws MailSendException Deprecated.since 4.4.0, UsesendEmail(com.atlassian.crowd.manager.mail.EmailMessage)
insteadSends an HTML email using the configured mail server (remote host / JNDI).- Parameters:
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 inbody
- Throws:
MailSendException
- an error occurred sending the email.
-
sendPlainTextEmail
@Deprecated void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body) throws MailSendException Deprecated.since 4.4.0, UsesendEmail(com.atlassian.crowd.manager.mail.EmailMessage)
insteadSends an email using the configured mail server (remote host / JNDI).- Parameters:
emailAddress
- address of recipient.subject
- subject header. Will be appended with the configured mail subject prefix in the final email.body
- email body text.- Throws:
MailSendException
- an error occurred sending the email.
-
sendPlainTextEmail
@Deprecated void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, Map<String, String> headers, Map<String, throws MailSendExceptionjavax.activation.DataSource> attachments) Deprecated.since 4.4.0, UsesendEmail(com.atlassian.crowd.manager.mail.EmailMessage)
insteadSends an email with zero or more attachments and headers using the configured mail server (remote host / JNDI).- Parameters:
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.- Throws:
MailSendException
- an error occurred sending the email.- Since:
- 2.11
-
sendTestMail
SendTestMailResult sendTestMail(SMTPServer smtpServer, javax.mail.internet.InternetAddress emailAddress) throws MailSendException Send a test email using the supplied mail server (remote host / JNDI)- Parameters:
smtpServer
- supplied SMTP Server, which will be used to send message.emailAddress
- address of recipient.- Returns:
- result of test, which contains logs and status.
- Throws:
MailSendException
- an error occurred sending the email.- Since:
- 3.2
-
sendEmails
Collection<? extends EmailMessage> sendEmails(Collection<? extends EmailMessage> messagesToSend) throws MailSendException Sends multiple emails using the configured mail server.- Returns:
- a collection of messages that failed to be sent
- Throws:
MailSendException
- an error occurred that prevented sending any email (connection error, configuration error, etc.).- Since:
- 3.3
-
sendEmail
Sends a single email using the configured mail server- Parameters:
messageToSend
- single email using the configured mail server- Throws:
MailSendException
- an error occurred sending the email.- Since:
- 4.4.0
-
validateConfiguration
Verifies whether the specified MailConfiguration is valid- Parameters:
mailConfiguration
- entity with attributes to be validated- Returns:
- a list with errors found in the configuration
- Since:
- 3.2
-
saveConfiguration
Deprecated.Useinstead
Sets the new mail configuration- Specified by:
saveConfiguration
in interfaceMailConfigurationService
- Parameters:
mailServerEntity
- new configuration- Since:
- 3.2
-
getMailConfiguration
Deprecated.Useinstead
Returns current mail configuration- Specified by:
getMailConfiguration
in interfaceMailConfigurationService
- Returns:
- Mail configuration
- Throws:
PropertyManagerException
- property does no exist- Since:
- 3.2
-
isConfigured
Deprecated.Useinstead
- Specified by:
isConfigured
in interfaceMailConfigurationService
- Returns:
true
if the mail server is fully configured (does not check if the configuration is correct)
-
instead