Class AbstractBaseMail
java.lang.Object
ch.tocco.nice2.messaging.mail.spi.AbstractBaseMail
- All Implemented Interfaces:
BaseMail
- Direct Known Subclasses:
AbstractOutgoingMail
,IncomeMailImpl
-
Field Summary
Modifier and TypeFieldDescriptionprotected List
<Attachment> protected List
<jakarta.mail.internet.InternetAddress> protected List
<jakarta.mail.internet.InternetAddress> protected jakarta.mail.internet.InternetAddress
protected String
protected final org.slf4j.Logger
protected List
<jakarta.mail.internet.InternetAddress> protected String
protected String
protected List
<jakarta.mail.internet.InternetAddress> Fields inherited from interface ch.tocco.nice2.messaging.mail.api.BaseMail
NO_SUBJECT
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractBaseMail
(org.slf4j.Logger log) protected
AbstractBaseMail
(org.slf4j.Logger log, String subject) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttachment
(Attachment attachment) void
addBcc
(jakarta.mail.internet.InternetAddress address) void
Add 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>"void
Add 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>"void
addCc
(jakarta.mail.internet.InternetAddress address) void
Add 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>"void
Add 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>"void
addReplyTo
(jakarta.mail.internet.InternetAddress address) void
addReplyTo
(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>"void
addReplyTo
(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>"void
addTo
(jakarta.mail.internet.InternetAddress address) void
Add 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 addressesvoid
Add 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 addressesvoid
void
clearBcc()
void
clearCc()
void
void
clearTo()
boolean
containsAttachment
(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.InternetAddress
getFrom()
getHtml()
List
<jakarta.mail.internet.InternetAddress> getText()
List
<jakarta.mail.internet.InternetAddress> getTo()
void
mergeWithExistingHtml
(String htmlToMerge) boolean
removeAttachment
(Attachment attachment) void
void
void
setFrom
(jakarta.mail.internet.InternetAddress from) void
void
setReplyTo
(Iterable<jakarta.mail.internet.InternetAddress> addresses) void
setSubject
(String subject) void
void
toString()
-
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:
getSubject
in interfaceBaseMail
-
getFrom
public jakarta.mail.internet.InternetAddress getFrom() -
getTo
-
getCc
-
getBcc
-
getReplyTo
- Specified by:
getReplyTo
in interfaceBaseMail
-
getText
-
getHtml
-
setSubject
- Specified by:
setSubject
in interfaceBaseMail
-
setFrom
public void setFrom(jakarta.mail.internet.InternetAddress from) -
addTo
public void addTo(jakarta.mail.internet.InternetAddress address) -
addTo
Description copied from interface:BaseMail
Add 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:BaseMail
Add 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:BaseMail
Add 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:BaseMail
Add 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:BaseMail
Add 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:BaseMail
Add 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
-
addReplyTo
public void addReplyTo(jakarta.mail.internet.InternetAddress address) - Specified by:
addReplyTo
in interfaceBaseMail
-
addReplyTo
Description copied from interface:BaseMail
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>"- Specified by:
addReplyTo
in interfaceBaseMail
- Parameters:
addresses
- List
-
addReplyTo
Description copied from interface:BaseMail
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>"- Specified by:
addReplyTo
in interfaceBaseMail
- Parameters:
addresses
- String separated with "," or "\n"
-
clearReplyTo
public void clearReplyTo()- Specified by:
clearReplyTo
in interfaceBaseMail
-
setReplyTo
-
setText
-
setHtml
-
mergeWithExistingHtml
-
createAttachment
public Attachment createAttachment(@Nullable @Nullable String id, @Nullable @Nullable String fileName, Binary binary) Description copied from interface:BaseMail
Adds 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:
createAttachment
in interfaceBaseMail
- Parameters:
id
- optional id for this attachmentfileName
- optional name for this attachmentbinary
- the content
-
createAttachment
- Specified by:
createAttachment
in interfaceBaseMail
-
createAttachment
public Attachment createAttachment(@Nullable @Nullable String id, jakarta.activation.MimeType mimeType) - Specified by:
createAttachment
in interfaceBaseMail
-
addAttachment
- Specified by:
addAttachment
in interfaceBaseMail
-
removeAttachment
- Specified by:
removeAttachment
in interfaceBaseMail
-
containsAttachment
- Specified by:
containsAttachment
in interfaceBaseMail
-
getAttachments
- Specified by:
getAttachments
in interfaceBaseMail
-
clearAttachments
public void clearAttachments()- Specified by:
clearAttachments
in interfaceBaseMail
-
toString
-