public final class MailService extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getNoReplyEmail()
Returns a no reply email address defined in config.properties
|
static IMailQueue |
getQueue()
Returns the mail queue
|
static String |
getSiteLink(String strBaseUrl,
boolean linkToFrontOffice)
Get a string that contains an html link to the site back office or front office.
|
static String |
getStrRecipients(List<String> listRecipients)
Return a String that contains a list of recipients separated with mail separator
|
static List<UrlAttachment> |
getUrlAttachmentList(String strHtml,
String strBaseUrl,
boolean useAbsoluteUrl)
Extract a collection of elements to be attached to a mail from an HTML string.
|
static void |
sendMailCalendar(String strRecipientsTo,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
String strCalendarMessage,
boolean bCreateEvent)
Send a calendar message asynchronously.
|
static void |
sendMailCalendar(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
String strCalendarMessage,
boolean bCreateEvent)
Send a calendar message asynchronously.
|
static void |
sendMailCalendar(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
String strCalendarMessage,
boolean bCreateEvent,
boolean bUniqueRecipientTo)
Send a calendar message asynchronously.
|
static void |
sendMailHtml(String strRecipientsTo,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage)
Send a HTML message asynchronously.
|
static void |
sendMailHtml(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage)
Send a HTML message asynchronously.
|
static void |
sendMailHtml(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
boolean bUniqueRecipientTo)
Send a HTML message asynchronously.
|
static void |
sendMailMultipartHtml(String strRecipientsTo,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
List<UrlAttachment> urlsAttachement)
Send a HTML message asynchronously with the attachments associated to the message .
|
static void |
sendMailMultipartHtml(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
List<UrlAttachment> urlsAttachement,
List<FileAttachment> filesAttachement)
Send a HTML message asynchronously with the attachments associated to the message and attached files .
|
static void |
sendMailMultipartHtml(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
List<UrlAttachment> urlsAttachement,
List<FileAttachment> filesAttachement,
boolean bUniqueRecipientTo)
Send a HTML message asynchronously with the attachments associated to the message and attached files .
|
static void |
sendMailMultipartText(String strRecipientsTo,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
List<FileAttachment> filesAttachement)
Send a text message asynchronously with attached files.
|
static void |
sendMailMultipartText(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
List<FileAttachment> filesAttachement)
Send a text message asynchronously with attached files.
|
static void |
sendMailMultipartText(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
List<FileAttachment> filesAttachement,
boolean bUniqueRecipientTo)
Send a text message asynchronously with attached files.
|
static void |
sendMailText(String strRecipientsTo,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage)
Send a text message asynchronously.
|
static void |
sendMailText(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage)
Send a text message asynchronously.
|
static void |
sendMailText(String strRecipientsTo,
String strRecipientsCc,
String strRecipientsBcc,
String strSenderName,
String strSenderEmail,
String strSubject,
String strMessage,
boolean bUniqueRecipientTo)
Send a text message asynchronously.
|
static void |
shutdown()
Shutdown the service
|
public static void sendMailHtml(String strRecipientsTo, String strSenderName, String strSenderEmail, String strSubject, String strMessage)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator define in config.propertiesstrSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.public static void sendMailHtml(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.public static void sendMailHtml(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, boolean bUniqueRecipientTo)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.bUniqueRecipientTo
- true if the mail must be send unitarily for each recipientpublic static void sendMailMultipartHtml(String strRecipientsTo, String strSenderName, String strSenderEmail, String strSubject, String strMessage, List<UrlAttachment> urlsAttachement)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.urlsAttachement
- The List of UrlAttachement Object, containing the URL of attachments associated with their content-location.public static void sendMailMultipartHtml(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, List<UrlAttachment> urlsAttachement, List<FileAttachment> filesAttachement)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.urlsAttachement
- The List of UrlAttachement Object, containing the URL of attachments associated with their content-locationfilesAttachement
- The list of attached files.public static void sendMailMultipartHtml(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, List<UrlAttachment> urlsAttachement, List<FileAttachment> filesAttachement, boolean bUniqueRecipientTo)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.urlsAttachement
- The List of UrlAttachement Object, containing the URL of attachments associated with their content-locationfilesAttachement
- The list of attached files.bUniqueRecipientTo
- true if the mail must be send unitarily for each recipientpublic static void sendMailCalendar(String strRecipientsTo, String strSenderName, String strSenderEmail, String strSubject, String strMessage, String strCalendarMessage, boolean bCreateEvent)
strRecipientsTo
- The list of the main recipients email. Every recipient must be separated by the mail separator defined in config.propertiesstrSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.strCalendarMessage
- The calendar messagebCreateEvent
- True to create the calendar event, false to remove itpublic static void sendMailCalendar(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, String strCalendarMessage, boolean bCreateEvent)
strRecipientsTo
- The list of the main recipients email. Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.strCalendarMessage
- The calendar messagebCreateEvent
- True to create the calendar event, false to remove itpublic static void sendMailCalendar(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, String strCalendarMessage, boolean bCreateEvent, boolean bUniqueRecipientTo)
strRecipientsTo
- The list of the main recipients email. Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.strCalendarMessage
- The calendar messagebCreateEvent
- True to create the calendar event, false to remove itbUniqueRecipientTo
- true if the mail must be send unitarily for each recipientpublic static void sendMailText(String strRecipientsTo, String strSenderName, String strSenderEmail, String strSubject, String strMessage)
strRecipientsTo
- The list of the main recipients email. Every recipient must be separated by the mail separator defined in config.propertiesstrSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.public static void sendMailText(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage)
strRecipientsTo
- The list of the main recipients email. Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.public static void sendMailText(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, boolean bUniqueRecipientTo)
strRecipientsTo
- The list of the main recipients email. Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.bUniqueRecipientTo
- true if the mail must be send unitarily for each recipientpublic static void sendMailMultipartText(String strRecipientsTo, String strSenderName, String strSenderEmail, String strSubject, String strMessage, List<FileAttachment> filesAttachement)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.filesAttachement
- The list of attached files.public static void sendMailMultipartText(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, List<FileAttachment> filesAttachement)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.filesAttachement
- The list of attached files.public static void sendMailMultipartText(String strRecipientsTo, String strRecipientsCc, String strRecipientsBcc, String strSenderName, String strSenderEmail, String strSubject, String strMessage, List<FileAttachment> filesAttachement, boolean bUniqueRecipientTo)
strRecipientsTo
- The list of the main recipients email.Every recipient must be separated by the mail separator defined in config.propertiesstrRecipientsCc
- The recipients list of the carbon copies .strRecipientsBcc
- The recipients list of the blind carbon copies .strSenderName
- The sender name.strSenderEmail
- The sender email address.strSubject
- The message subject.strMessage
- The message.filesAttachement
- The list of attached files.bUniqueRecipientTo
- true if the mail must be send unitarily for each recipientpublic static void shutdown()
public static String getNoReplyEmail()
public static IMailQueue getQueue()
public static List<UrlAttachment> getUrlAttachmentList(String strHtml, String strBaseUrl, boolean useAbsoluteUrl)
strHtml
- The HTML code.strBaseUrl
- The base url, can be null in order to extract all urls.useAbsoluteUrl
- Determine if we use absolute or relative url for attachement content-locationpublic static String getStrRecipients(List<String> listRecipients)
listRecipients
- a list of string recipientspublic static String getSiteLink(String strBaseUrl, boolean linkToFrontOffice)
strBaseUrl
- The base url of the sitelinkToFrontOffice
- True if the link should be directed to the front office, false if it should be directed to the back office.Copyright © 2020 City of Paris. All rights reserved.