Top Description Fields Constructors Methods
org.springframework.mail.javamail

pack-priv Class SmartMimeMessage

extends MimeMessage
Class Inheritance
Imports
jakarta.activation.FileTypeMap, jakarta.mail.Session, jakarta.mail.internet.MimeMessage, org.springframework.lang.Nullable

Special subclass of the standard JavaMail MimeMessage, carrying a default encoding to be used when populating the message and a default Java Activation FileTypeMap to be used for resolving attachment types.

Created by JavaMailSenderImpl in case of a specified default encoding and/or default FileTypeMap. Autodetected by MimeMessageHelper, which will use the carried encoding and FileTypeMap unless explicitly overridden.

Author
Juergen Hoeller
Since
1.2
See Also
JavaMailSenderImpl#createMimeMessage(), MimeMessageHelper#getDefaultEncoding(jakarta.mail.internet.MimeMessage), MimeMessageHelper#getDefaultFileTypeMap(jakarta.mail.internet.MimeMessage)

Field Summary

Modifier and TypeField and Description
private final String
private final FileTypeMap
Inherited from jakarta.mail.internet.MimeMessage:
cachedContentcontentcontentStreamdhflagsheadersmodifiedsaved

Constructor Summary

AccessConstructor and Description
public
SmartMimeMessage(Session
the JavaMail Session to create the message for
session
,
String
the default encoding, or null if none
defaultEncoding
,
FileTypeMap
the default FileTypeMap, or null if none
defaultFileTypeMap
)

Create a new SmartMimeMessage.

Method Summary

Modifier and TypeMethod and Description
public final String
getDefaultEncoding()

Return the default encoding of this message, or null if none.

public final FileTypeMap
getDefaultFileTypeMap()

Return the default FileTypeMap of this message, or null if none.

Inherited from jakarta.mail.internet.MimeMessage:
addFromaddHeaderaddHeaderLineaddRecipientsaddRecipientscreateInternetHeaderscreateMimeMessagegetAllHeaderLinesgetAllHeadersgetAllRecipientsgetContentgetContentIDgetContentLanguagegetContentMD5getContentStreamgetContentTypegetDataHandlergetDescriptiongetDispositiongetEncodinggetFileNamegetFlagsgetFromgetHeadergetHeadergetInputStreamgetLineCountgetMatchingHeaderLinesgetMatchingHeadersgetMessageIDgetNonMatchingHeaderLinesgetNonMatchingHeadersgetRawInputStreamgetReceivedDategetRecipientsgetReplyTogetSendergetSentDategetSizegetSubjectisMimeTypeisSetparseremoveHeaderreplyreplysaveChangessetContentsetContentsetContentIDsetContentLanguagesetContentMD5setDataHandlersetDescriptionsetDescriptionsetDispositionsetFileNamesetFlagssetFromsetFromsetFromsetHeadersetRecipientssetRecipientssetReplyTosetSendersetSentDatesetSubjectsetSubjectsetTextsetTextsetTextupdateHeadersupdateMessageIDwriteTowriteTo

Field Detail

defaultEncodingback to summary
private final String defaultEncoding
Annotations
@Nullable
defaultFileTypeMapback to summary
private final FileTypeMap defaultFileTypeMap
Annotations
@Nullable

Constructor Detail

SmartMimeMessageback to summary
public SmartMimeMessage(Session session, String defaultEncoding, FileTypeMap defaultFileTypeMap)

Create a new SmartMimeMessage.

Parameters
session:Session

the JavaMail Session to create the message for

defaultEncoding:String

the default encoding, or null if none

defaultFileTypeMap:FileTypeMap

the default FileTypeMap, or null if none

Method Detail

getDefaultEncodingback to summary
public final String getDefaultEncoding()

Return the default encoding of this message, or null if none.

Annotations
@Nullable
getDefaultFileTypeMapback to summary
public final FileTypeMap getDefaultFileTypeMap()

Return the default FileTypeMap of this message, or null if none.

Annotations
@Nullable