Package org.opencastproject.kernel.mail
Class SmtpService
java.lang.Object
org.opencastproject.kernel.mail.BaseSmtpService
org.opencastproject.kernel.mail.SmtpService
- All Implemented Interfaces:
org.osgi.service.cm.ManagedService
OSGi service that allows to send e-mails using
javax.mail.-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.kernel.mail.BaseSmtpService
BaseSmtpService.Mode -
Field Summary
Fields inherited from class org.opencastproject.kernel.mail.BaseSmtpService
mailTransport, OPT_MAIL_AUTH_SUFFIX, OPT_MAIL_DEBUG, OPT_MAIL_FROM, OPT_MAIL_HOST_SUFFIX, OPT_MAIL_PASSWORD, OPT_MAIL_PORT_SUFFIX, OPT_MAIL_PREFIX, OPT_MAIL_TLS_ENABLE_SUFFIX, OPT_MAIL_TRANSPORT, OPT_MAIL_USER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSend a message to multiple recipientsvoidSend a message to multiple recipientsvoidMethod to send a messagevoidMethod to send a messagevoidSend a message to multiple recipientsvoidSend a message to multiple recipientsvoidupdated(Dictionary<String, ?> properties) Callback from the OSGiConfigurationAdminon configuration changes.Methods inherited from class org.opencastproject.kernel.mail.BaseSmtpService
configure, createMessage, getSender, getSession, isProductionMode, send, setDebug, setHost, setMailTransport, setPassword, setPort, setProductionMode, setSender, setSsl, setUser
-
Constructor Details
-
SmtpService
public SmtpService()
-
-
Method Details
-
updated
public void updated(Dictionary<String, ?> properties) throws org.osgi.service.cm.ConfigurationExceptionCallback from the OSGiConfigurationAdminon configuration changes.- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Parameters:
properties- the configuration properties- Throws:
org.osgi.service.cm.ConfigurationException- if configuration fails
-
send
Method to send a message- Parameters:
to- Recipient of the messagesubject- Subject of the messagebodyText- Text body of the message (null if there should be no text part)- Throws:
javax.mail.MessagingException- if sending the message failed
-
send
public void send(String to, String subject, String bodyText, String bodyHTML) throws javax.mail.MessagingException Method to send a message- Parameters:
to- Recipient of the messagesubject- Subject of the messagebodyText- Text body of the message (null if there should be no text part)bodyHTML- HTML body of the message (null if there should be no HTML part)- Throws:
javax.mail.MessagingException- if sending the message failed
-
send
public void send(String to, String cc, String bcc, String subject, String bodyText) throws javax.mail.MessagingException Send a message to multiple recipients- Parameters:
to- "To:" message recipient(s), separated by commas and/or spacescc- "CC:" message recipient(s), separated by commas and/or spacesbcc- "BCC:" message recipient(s), separated by commas and/or spacessubject- Subject of the messagebodyText- Text body of the message (null if there should be no text part)- Throws:
javax.mail.MessagingException- if sending the message failed
-
send
public void send(String to, String cc, String bcc, String subject, String bodyText, String bodyHTML) throws javax.mail.MessagingException Send a message to multiple recipients- Parameters:
to- "To:" message recipient(s), separated by commas and/or spacescc- "CC:" message recipient(s), separated by commas and/or spacesbcc- "BCC:" message recipient(s), separated by commas and/or spacessubject- Subject of the messagebodyText- Text body of the message (null if there should be no text part)bodyHTML- HTML body of the message (null if there should be no HTML part)- Throws:
javax.mail.MessagingException- if sending the message failed
-
send
public void send(String[] to, String[] cc, String[] bcc, String subject, String bodyText) throws javax.mail.MessagingException Send a message to multiple recipients- Parameters:
to- Array with the "To:" recipients of the messagecc- Array with the "CC:" recipients of the messagebcc- Array with the "BCC:" recipients of the messagesubject- Subject of the messagebodyText- Text body of the message (null if there should be no text part)- Throws:
javax.mail.MessagingException- if sending the message failed
-
send
public void send(String[] to, String[] cc, String[] bcc, String subject, String bodyText, String bodyHTML) throws javax.mail.MessagingException Send a message to multiple recipients- Parameters:
to- Array with the "To:" recipients of the messagecc- Array with the "CC:" recipients of the messagebcc- Array with the "BCC:" recipients of the messagesubject- Subject of the messagebodyText- Text body of the message (null if there should be no text part)bodyHTML- HTML body of the message (null if there should be no HTML part)- Throws:
javax.mail.MessagingException- if sending the message failedIllegalArgumentException- if both bodyText and bodyHTML are null
-