Class AbstractBaseMail
java.lang.Object
ch.tocco.nice2.messaging.mail.spi.AbstractBaseMail
- All Implemented Interfaces:
BaseMail
- Direct Known Subclasses:
AbstractOutgoingMail,IncomeMailImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Attachment> protected List<jakarta.mail.internet.InternetAddress> protected List<jakarta.mail.internet.InternetAddress> protected jakarta.mail.internet.InternetAddressprotected Stringprotected final org.slf4j.Loggerprotected List<jakarta.mail.internet.InternetAddress> protected Stringprotected Stringprotected List<jakarta.mail.internet.InternetAddress> Fields inherited from interface ch.tocco.nice2.messaging.mail.api.BaseMail
NO_SUBJECT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractBaseMail(org.slf4j.Logger log) protectedAbstractBaseMail(org.slf4j.Logger log, String subject) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(Attachment attachment) voidaddBcc(jakarta.mail.internet.InternetAddress address) voidAdd addresses from a String to "bcc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"voidAdd addresses from aList<String>to "bcc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"voidaddCc(jakarta.mail.internet.InternetAddress address) voidAdd addresses from a String to "cc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"voidAdd addresses from a Listto "cc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"voidaddReplyTo(jakarta.mail.internet.InternetAddress address) voidaddReplyTo(String addresses) Add addresses from a String to "replyTo".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"voidaddReplyTo(List<String> addresses) Add addresses from aList<String>to "replyTo".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"voidaddTo(jakarta.mail.internet.InternetAddress address) voidAdd addresses from a String to "to".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" This is only necessary if no recipient entity is set or if you want to add further addressesvoidAdd addresses from aList<String>to "to".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" This is only necessary if no recipient entity is set or if you want to add further addressesvoidvoidclearBcc()voidclearCc()voidvoidclearTo()booleancontainsAttachment(Attachment attachment) createAttachment(jakarta.activation.MimeType mimeType) createAttachment(@Nullable String id, jakarta.activation.MimeType mimeType) createAttachment(@Nullable String id, @Nullable String fileName, Binary binary) Adds the given attachment to this mail.List<jakarta.mail.internet.InternetAddress> getBcc()List<jakarta.mail.internet.InternetAddress> getCc()jakarta.mail.internet.InternetAddressgetFrom()getHtml()List<jakarta.mail.internet.InternetAddress> getText()List<jakarta.mail.internet.InternetAddress> getTo()booleanbooleanvoidmergeWithExistingHtml(String htmlToMerge) booleanremoveAttachment(Attachment attachment) voidvoidvoidsetFrom(jakarta.mail.internet.InternetAddress from) voidvoidsetReplyTo(Iterable<jakarta.mail.internet.InternetAddress> addresses) voidsetSubject(String subject) voidvoidtoString()
-
Field Details
-
log
protected final org.slf4j.Logger log -
subject
-
from
protected jakarta.mail.internet.InternetAddress from -
to
-
cc
-
bcc
-
replyTo
-
text
-
html
-
attachments
-
-
Constructor Details
-
AbstractBaseMail
-
AbstractBaseMail
protected AbstractBaseMail(org.slf4j.Logger log)
-
-
Method Details
-
getSubject
- Specified by:
getSubjectin interfaceBaseMail
-
getFrom
public jakarta.mail.internet.InternetAddress getFrom() -
getTo
-
getCc
-
getBcc
-
getReplyTo
- Specified by:
getReplyToin interfaceBaseMail
-
getText
-
getHtml
-
setSubject
- Specified by:
setSubjectin interfaceBaseMail
-
setFrom
public void setFrom(jakarta.mail.internet.InternetAddress from) -
addTo
public void addTo(jakarta.mail.internet.InternetAddress address) -
addTo
Description copied from interface:BaseMailAdd addresses from aList<String>to "to".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" This is only necessary if no recipient entity is set or if you want to add further addresses -
addTo
Description copied from interface:BaseMailAdd addresses from a String to "to".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" This is only necessary if no recipient entity is set or if you want to add further addresses -
clearTo
public void clearTo() -
setTo
-
addCc
public void addCc(jakarta.mail.internet.InternetAddress address) -
addCc
Description copied from interface:BaseMailAdd addresses from a Listto "cc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" -
addCc
Description copied from interface:BaseMailAdd addresses from a String to "cc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" -
clearCc
public void clearCc() -
setCc
-
addBcc
public void addBcc(jakarta.mail.internet.InternetAddress address) -
addBcc
Description copied from interface:BaseMailAdd addresses from aList<String>to "bcc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" -
addBcc
Description copied from interface:BaseMailAdd addresses from a String to "bcc".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>" -
clearBcc
public void clearBcc() -
setBcc
-
hasNoRecipients
public boolean hasNoRecipients()- Specified by:
hasNoRecipientsin interfaceBaseMail
-
addReplyTo
public void addReplyTo(jakarta.mail.internet.InternetAddress address) - Specified by:
addReplyToin interfaceBaseMail
-
addReplyTo
Description copied from interface:BaseMailAdd addresses from aList<String>to "replyTo".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"- Specified by:
addReplyToin interfaceBaseMail- Parameters:
addresses- List
-
addReplyTo
Description copied from interface:BaseMailAdd addresses from a String to "replyTo".
Can be either only email or email and name in format: "firstname lastname <email>.
example: "Hans Meier <hmeier@tocco.ch>"- Specified by:
addReplyToin interfaceBaseMail- Parameters:
addresses- String separated with "," or "\n"
-
clearReplyTo
public void clearReplyTo()- Specified by:
clearReplyToin interfaceBaseMail
-
setReplyTo
-
setText
-
setHtml
-
isBodyEmpty
public boolean isBodyEmpty()- Specified by:
isBodyEmptyin interfaceBaseMail
-
mergeWithExistingHtml
-
createAttachment
public Attachment createAttachment(@Nullable @Nullable String id, @Nullable @Nullable String fileName, Binary binary) Description copied from interface:BaseMailAdds the given attachment to this mail. The content is taken from the given binary. The returned attachment is restricted in that it is not allowed to load new content using methodsAttachment.setContent(byte[]),Attachment.loadContent(java.io.InputStream)orAttachment.setMimeType(MimeType)for setting the mime type- Specified by:
createAttachmentin interfaceBaseMail- Parameters:
id- optional id for this attachmentfileName- optional name for this attachmentbinary- the content
-
createAttachment
- Specified by:
createAttachmentin interfaceBaseMail
-
createAttachment
public Attachment createAttachment(@Nullable @Nullable String id, jakarta.activation.MimeType mimeType) - Specified by:
createAttachmentin interfaceBaseMail
-
addAttachment
- Specified by:
addAttachmentin interfaceBaseMail
-
removeAttachment
- Specified by:
removeAttachmentin interfaceBaseMail
-
containsAttachment
- Specified by:
containsAttachmentin interfaceBaseMail
-
getAttachments
- Specified by:
getAttachmentsin interfaceBaseMail
-
clearAttachments
public void clearAttachments()- Specified by:
clearAttachmentsin interfaceBaseMail
-
toString
-