spring-framework / org.springframework.mail.javamail

Package org.springframework.mail.javamail

Types

ConfigurableMimeFileTypeMap

open class ConfigurableMimeFileTypeMap : FileTypeMap, InitializingBean

Spring-configurable FileTypeMap implementation that will read MIME type to file extension mappings from a standard JavaMail MIME type mapping file, using a standard MimetypesFileTypeMap underneath.

The mapping file should be in the following format, as specified by the Java Activation Framework:

 # map text/html to .htm and .html files text/html html htm HTML HTM
Lines starting with # are treated as comments and are ignored. All other lines are treated as mappings. Each mapping line should contain the MIME type as the first entry and then each file extension to map to that MIME type as subsequent entries. Each entry is separated by spaces or tabs.

By default, the mappings in the mime.types file located in the same package as this class are used, which cover many common file extensions (in contrast to the out-of-the-box mappings in activation.jar). This can be overridden using the mappingLocation property.

Additional mappings can be added via the mappings bean property, as lines that follow the mime.types file format.

InternetAddressEditor

open class InternetAddressEditor : PropertyEditorSupport

Editor for java.mail.internet.InternetAddress, to directly populate an InternetAddress property.

Expects the same syntax as InternetAddress's constructor with a String argument. Converts empty Strings into null values.

JavaMailSenderImpl

open class JavaMailSenderImpl : JavaMailSender

Production implementation of the JavaMailSender interface, supporting both JavaMail MimeMessage and Spring SimpleMailMessage. Can also be used as a plain org.springframework.mail.MailSender implementation.

Allows for defining all settings locally as bean properties. Alternatively, a pre-configured JavaMail javax.mail.Session can be specified, possibly pulled from an application server's JNDI environment.

Non-default properties in this object will always override the settings in the JavaMail Session. Note that if overriding all values locally, there is no added value in setting a pre-configured Session.

MimeMailMessage

open class MimeMailMessage : MailMessage

Implementation of the MailMessage interface for a JavaMail MIME message, to let message population code interact with a simple message or a MIME message through a common interface.

Uses a MimeMessageHelper underneath. Can either be created with a MimeMessageHelper instance or with a JavaMail MimeMessage instance.