|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.util.mail.MailHelper
public class MailHelper
Description:
Some mail helpers
Initial Date: 21.11.2006
| Constructor Summary | |
|---|---|
MailHelper()
|
|
| Method Summary | |
|---|---|
static void |
appendErrorsAndWarnings(MailerResult mailerResult,
java.lang.StringBuilder errors,
java.lang.StringBuilder warnings,
java.util.Locale locale)
Method to evaluate the mailer result. |
static javax.mail.internet.MimeMessage |
createMessage()
Create a configures mail message object that is ready to use |
static javax.mail.internet.MimeMessage |
createMessage(javax.mail.Address from,
javax.mail.Address[] recipients,
javax.mail.Address[] recipientsCC,
javax.mail.Address[] recipientsBCC,
java.lang.String body,
java.lang.String subject,
java.io.File[] attachments,
MailerResult result)
create MimeMessage from given fields, this may be used for creation of the email but sending it later. |
static java.lang.String |
getMailFooter(java.util.Locale locale,
Identity sender)
Create a mail footer for the given locale and sender. |
static java.lang.Object |
getMailhost()
|
static java.lang.String |
getMessageForFailedUsersError(java.util.Locale locale,
java.util.List<Identity> disabledIdentities)
|
static java.lang.String |
getTitleForFailedUsersError(java.util.Locale locale)
|
static boolean |
isValidEmailAddress(java.lang.String mailAddress)
Checks if the given mail address is potentially a valid email address that can be used to send emails. |
static void |
printErrorsAndWarnings(MailerResult mailerResult,
WindowControl wControl,
java.util.Locale locale)
Method to evaluate the mailer result and disply general error and warning messages. |
static MailerResult |
removeDisabledMailAddress(java.util.List<Identity> identities,
MailerResult result)
check for disabled mail address |
static void |
sendMessage(javax.mail.Address from,
javax.mail.Address[] recipients,
javax.mail.Address[] recipientsCC,
javax.mail.Address[] recipientsBCC,
java.lang.String body,
java.lang.String subject,
java.io.File[] attachments,
MailerResult result)
Send an email message to the given TO, CC and BCC address. |
static void |
sendMessage(javax.mail.internet.MimeMessage msg,
MailerResult result)
send email with MimeMessage available |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailHelper()
| Method Detail |
|---|
public static javax.mail.internet.MimeMessage createMessage()
public static javax.mail.internet.MimeMessage createMessage(javax.mail.Address from,
javax.mail.Address[] recipients,
javax.mail.Address[] recipientsCC,
javax.mail.Address[] recipientsBCC,
java.lang.String body,
java.lang.String subject,
java.io.File[] attachments,
MailerResult result)
from - recipients - recipientsCC - recipientsBCC - body - subject - attachments - result -
public static void sendMessage(javax.mail.Address from,
javax.mail.Address[] recipients,
javax.mail.Address[] recipientsCC,
javax.mail.Address[] recipientsBCC,
java.lang.String body,
java.lang.String subject,
java.io.File[] attachments,
MailerResult result)
from - Address used as sender address. Must not be NULLrecipients - Address array used as sender addresses. Must not be NULL
and contain at lease one addressrecipientsCC - Address array used as CC addresses. Can be NULLrecipientsBCC - Address array used as BCC addresses. Can be NULLbody - Body text of message. Must not be NULLsubject - Subject text of message. Must not be NULLattachments - File array used as attachments. Can be NULLresult - MailerResult object that stores the result code
public static void sendMessage(javax.mail.internet.MimeMessage msg,
MailerResult result)
msg - result - public static java.lang.Object getMailhost()
public static java.lang.String getMailFooter(java.util.Locale locale,
Identity sender)
locale - Defines language of footer text. If null, the systems default
locale is usedsender - Details about sender embedded in mail footer. If null no such
details are attached to the footer
public static java.lang.String getTitleForFailedUsersError(java.util.Locale locale)
public static java.lang.String getMessageForFailedUsersError(java.util.Locale locale,
java.util.List<Identity> disabledIdentities)
public static void printErrorsAndWarnings(MailerResult mailerResult,
WindowControl wControl,
java.util.Locale locale)
mailerResult - The mailer result to be evaluatedwControl - The current window controllerlocale - The users local
public static void appendErrorsAndWarnings(MailerResult mailerResult,
java.lang.StringBuilder errors,
java.lang.StringBuilder warnings,
java.util.Locale locale)
mailerResult - The mailer result to be evaluatederrors - StringBuilder for the error messageswarnings - StringBuilder for the warningslocale - The users localpublic static boolean isValidEmailAddress(java.lang.String mailAddress)
mailAddress -
public static MailerResult removeDisabledMailAddress(java.util.List<Identity> identities,
MailerResult result)
recipients - result -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||