| java.lang.Object org.sakaiproject.email.impl.BasicEmailService
All known Subclasses: org.sakaiproject.email.impl.EmailServiceTest,
BasicEmailService | abstract public class BasicEmailService implements EmailService(Code) | |
BasicEmailService implements the EmailService.
|
Inner Class :protected class MyMessage extends MimeMessage | |
Field Summary | |
final protected static String | CONTENT_TYPE | final protected static String | POSTMASTER | final protected static String | SMTP_FROM Email address to use for SMTP MAIL command. | final protected static String | SMTP_HOST The SMTP server to connect to. | final protected static String | SMTP_PORT The SMTP server port to connect to, if the connect() method doesn't explicitly specify one. | final protected static String | SMTP_PROTOCOL Protocol name for smtp. | final protected static String | SMTP_SENDPARTIAL If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. | protected int | m_maxRecipients The max # recipients to include in each message. | protected boolean | m_oneMessagePerConnection Configuration: use a connection to the SMTP for only one message (or not). | protected String | m_smtp Configuration: smtp server to use. | protected String | m_smtpFrom Configuration: optional smtp mail envelope return address. | protected String | m_smtpPort Configuration: smtp server port to use. | protected boolean | m_testMode Configuration: set to go into test mode, where mail is not really sent out. |
Method Summary | |
protected String | arrayToStr(Object[] array) | protected static boolean | canUseCharset(String content, String charsetName) | protected String | cleanUp(String str) | public void | destroy() Final cleanup. | public void | init() Final initialization, once all dependencies are set. | protected String | listToStr(Collection list) | public void | send(String fromStr, String toStr, String subject, String content, String headerToStr, String replyToStr, List additionalHeaders) | public void | sendMail(InternetAddress from, InternetAddress[] to, String subject, String content, InternetAddress[] headerTo, InternetAddress[] replyTo, List additionalHeaders) | public void | sendToUsers(Collection users, Collection headers, String message) | abstract protected ServerConfigurationService | serverConfigurationService() | public void | setMaxRecipients(String setting) Set max # recipients to include in each message.
Parameters: setting - The max # recipients to include in each message. | public void | setOneMessagePerConnection(boolean value) | public void | setSmtp(String value) Configuration: smtp server to use. | public void | setSmtpFrom(String value) Configuration: smtp mail envelope return address. | public void | setSmtpPort(String value) Configuration: smtp server port to use. | public void | setTestMode(boolean value) Configuration: set test mode. | protected void | testSend(String fromStr, String toStr, String subject, String content, String headerToStr, String replyToStr, List additionalHeaders) | protected void | testSendMail(InternetAddress from, InternetAddress[] to, String subject, String content, InternetAddress[] headerTo, InternetAddress[] replyTo, List additionalHeaders) | protected String | usersToStr(Collection users) |
CONTENT_TYPE | final protected static String CONTENT_TYPE(Code) | | |
SMTP_FROM | final protected static String SMTP_FROM(Code) | | Email address to use for SMTP MAIL command. This sets the envelope return address. Defaults to msg.getFrom() or InternetAddress.getLocalAddress(). NOTE: mail.smtp.user was previously used for this.
|
SMTP_HOST | final protected static String SMTP_HOST(Code) | | The SMTP server to connect to.
|
SMTP_PORT | final protected static String SMTP_PORT(Code) | | The SMTP server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 25.
|
SMTP_PROTOCOL | final protected static String SMTP_PROTOCOL(Code) | | Protocol name for smtp.
|
SMTP_SENDPARTIAL | final protected static String SMTP_SENDPARTIAL(Code) | | If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is
an invalid recipient address.
|
m_maxRecipients | protected int m_maxRecipients(Code) | | The max # recipients to include in each message.
|
m_oneMessagePerConnection | protected boolean m_oneMessagePerConnection(Code) | | Configuration: use a connection to the SMTP for only one message (or not).
|
m_smtp | protected String m_smtp(Code) | | Configuration: smtp server to use.
|
m_smtpFrom | protected String m_smtpFrom(Code) | | Configuration: optional smtp mail envelope return address.
|
m_smtpPort | protected String m_smtpPort(Code) | | Configuration: smtp server port to use.
|
m_testMode | protected boolean m_testMode(Code) | | Configuration: set to go into test mode, where mail is not really sent out.
|
canUseCharset | protected static boolean canUseCharset(String content, String charsetName)(Code) | | Returns true if the given content String can be encoded in the given charset
|
destroy | public void destroy()(Code) | | Final cleanup.
|
init | public void init()(Code) | | Final initialization, once all dependencies are set.
|
sendMail | public void sendMail(InternetAddress from, InternetAddress[] to, String subject, String content, InternetAddress[] headerTo, InternetAddress[] replyTo, List additionalHeaders)(Code) | | |
setMaxRecipients | public void setMaxRecipients(String setting)(Code) | | Set max # recipients to include in each message.
Parameters: setting - The max # recipients to include in each message. (as an integer string). |
setOneMessagePerConnection | public void setOneMessagePerConnection(boolean value)(Code) | | Configuration: set use a connection to the SMTP for only one message (or not)
Parameters: value - The setting |
setSmtp | public void setSmtp(String value)(Code) | | Configuration: smtp server to use.
Parameters: value - The smtp server string. |
setSmtpFrom | public void setSmtpFrom(String value)(Code) | | Configuration: smtp mail envelope return address.
Parameters: value - The smtp mail from address string. |
setSmtpPort | public void setSmtpPort(String value)(Code) | | Configuration: smtp server port to use.
Parameters: value - The smtp server port string. |
setTestMode | public void setTestMode(boolean value)(Code) | | Configuration: set test mode.
Parameters: value - The test mode value |
testSendMail | protected void testSendMail(InternetAddress from, InternetAddress[] to, String subject, String content, InternetAddress[] headerTo, InternetAddress[] replyTo, List additionalHeaders)(Code) | | test version of sendMail
|
|
|