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
public class SmtpService extends BaseSmtpService implements org.osgi.service.cm.ManagedService
OSGi service that allows to send e-mails usingjavax.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 Constructor Description SmtpService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
send(String[] to, String[] cc, String[] bcc, String subject, String bodyText)
Send a message to multiple recipientsvoid
send(String[] to, String[] cc, String[] bcc, String subject, String bodyText, String bodyHTML)
Send a message to multiple recipientsvoid
send(String to, String subject, String bodyText)
Method to send a messagevoid
send(String to, String subject, String bodyText, String bodyHTML)
Method to send a messagevoid
send(String to, String cc, String bcc, String subject, String bodyText)
Send a message to multiple recipientsvoid
send(String to, String cc, String bcc, String subject, String bodyText, String bodyHTML)
Send a message to multiple recipientsvoid
updated(Dictionary<String,?> properties)
Callback from the OSGiConfigurationAdmin
on configuration changes.-
Methods inherited from class org.opencastproject.kernel.mail.BaseSmtpService
configure, createMessage, getSession, isProductionMode, send, setDebug, setHost, setMailTransport, setPassword, setPort, setProductionMode, setSender, setSsl, setUser
-
-
-
-
Method Detail
-
updated
public void updated(Dictionary<String,?> properties) throws org.osgi.service.cm.ConfigurationException
Callback from the OSGiConfigurationAdmin
on configuration changes.- Specified by:
updated
in interfaceorg.osgi.service.cm.ManagedService
- Parameters:
properties
- the configuration properties- Throws:
org.osgi.service.cm.ConfigurationException
- if configuration fails
-
send
public void send(String to, String subject, String bodyText) 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)- 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
-
-