Package jenkins.plugins.mailer.tasks
Class MimeMessageBuilder
java.lang.Object
jenkins.plugins.mailer.tasks.MimeMessageBuilder
Builder for
MimeMessage
. This class is NOT thread-safe.- Author:
- tom.fennelly@gmail.com
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddRecipients
(String recipients) addRecipients
(String recipients, jakarta.mail.Message.RecipientType recipientType) Adds the given recipients to the current MIME message.addReplyTo
(String replyTo) jakarta.mail.internet.MimeMessage
Build aMimeMessage
instance from the set of supplied parameters.setCharset
(String charset) setDefaultSuffix
(String defaultSuffix) static void
setInReplyTo
(jakarta.mail.internet.MimeMessage msg, String inReplyTo) setListener
(TaskListener listener) setMimeType
(String mimeType) setRecipientFilter
(MimeMessageBuilder.AddressFilter recipientFilter) setReplyTo
(String replyTo) setSubject
(String subject)
-
Constructor Details
-
MimeMessageBuilder
public MimeMessageBuilder()
-
-
Method Details
-
setCharset
-
setMimeType
-
setListener
-
setDefaultSuffix
-
setFrom
-
setReplyTo
-
addReplyTo
-
setSubject
-
setBody
-
setRecipientFilter
-
addRecipients
public MimeMessageBuilder addRecipients(@NonNull String recipients) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
addRecipients
public MimeMessageBuilder addRecipients(@NonNull String recipients, @NonNull jakarta.mail.Message.RecipientType recipientType) throws UnsupportedEncodingException Adds the given recipients to the current MIME message.- Parameters:
recipients
- one or more recipientsrecipientType
- recipient type- Returns:
- the constructed message with the given recipients
- Throws:
UnsupportedEncodingException
- in case of encoding problems
-
buildMimeMessage
public jakarta.mail.internet.MimeMessage buildMimeMessage() throws jakarta.mail.MessagingException, UnsupportedEncodingExceptionBuild aMimeMessage
instance from the set of supplied parameters.- Returns:
- The
MimeMessage
instance; - Throws:
jakarta.mail.MessagingException
- in case the mail cannot be createdUnsupportedEncodingException
- in case of encoding problems
-
setInReplyTo
public static void setInReplyTo(@NonNull jakarta.mail.internet.MimeMessage msg, @NonNull String inReplyTo) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-