Interface MailServer
-
@SupportedAll public interface MailServer
Pluggable interface for all email sending in OpenAM. Can be configured on a per-realm or global basis via theforgerockMailServerImplClassName
attribute of the Email Service.The implementation must provide a constructor taking a single String argument, which is the name of the realm that service is being constructed for.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
sendEmail(String to, String subject, String message)
Sends an email message using default MailServer settingsvoid
sendEmail(String to, String subject, String message, String mimeType)
Sends an email message using default MailServer settings.void
sendEmail(String from, String to, String subject, String message, Map<String,Set<String>> options)
Sends an email message using specified options given for the MailServer settingsvoid
sendHtmlEmail(String to, String subject, String message)
Sends an email message, containing HTML, using default MailServer settings.void
sendHtmlEmail(String from, String to, String subject, String message, Map<String,Set<String>> options)
Sends an email message, containing HTML, using specified options given for the MailServer settings.
-
-
-
Method Detail
-
sendHtmlEmail
void sendHtmlEmail(String to, String subject, String message) throws javax.mail.MessagingException
Sends an email message, containing HTML, using default MailServer settings.- Parameters:
to
- The address that the E-mail message is sent.subject
- The E-mail subject.message
- The content contained in the E-mail message.- Throws:
javax.mail.MessagingException
- in the case where the module was unable to send the e-mail.
-
sendHtmlEmail
void sendHtmlEmail(String from, String to, String subject, String message, Map<String,Set<String>> options) throws javax.mail.MessagingException
Sends an email message, containing HTML, using specified options given for the MailServer settings.- Parameters:
from
- The address that sends the E-mail message.to
- The address that the E-mail message is sent.subject
- The E-mail subject.message
- The content contained in the E-mail message.options
- SMTPHostName, SMTPPort, SMTPUser, SMTPUserPassword.- Throws:
javax.mail.MessagingException
- in case where the module was unable to send the e-mail.
-
sendEmail
void sendEmail(String from, String to, String subject, String message, Map<String,Set<String>> options) throws javax.mail.MessagingException
Sends an email message using specified options given for the MailServer settings- Parameters:
from
- The address that sends the E-mail messageto
- The address that the E-mail message is sentsubject
- The E-mail subjectmessage
- The content contained in the E-mail messageoptions
- SMTPHostName, SMTPPort, SMTPUser, SMTPUserPassword- Throws:
javax.mail.MessagingException
- in case where the module was unable to send the e-mail
-
sendEmail
void sendEmail(String to, String subject, String message) throws javax.mail.MessagingException
Sends an email message using default MailServer settings- Parameters:
to
- The address that the E-mail message is sentsubject
- The E-mail subjectmessage
- The content contained in the E-mail message- Throws:
javax.mail.MessagingException
- in the case where the module was unable to send the e-mail
-
sendEmail
void sendEmail(String to, String subject, String message, String mimeType) throws javax.mail.MessagingException
Sends an email message using default MailServer settings.- Parameters:
to
- the address that the email message is sentsubject
- the E-mail subjectmessage
- the content contained in the email messagemimeType
- the mime type to be used for the email- Throws:
javax.mail.MessagingException
- in the case where the module was unable to send the email
-
-