Sending Email - Default

By default, CAS sends email through an SMTP server using the JavaMail API.

The default strategy uses the JavaMail API which provides a platform-independent and protocol-independent framework to build mail and messaging applications, primarily using SMTP:

The following settings may also need to be defined to describe the mail server settings:

spring.mail.default-encodingDefault MimeMessage encoding.
UTF-8
Third party

Default MimeMessage encoding.

Type
Charset
Default
UTF-8
Defined by
MailProperties
spring.mail.hostSMTP server host.
no default
Third party

SMTP server host. For instance, 'smtp.example.com'.

Type
String
Default
none
Defined by
MailProperties
spring.mail.jndi-nameSession JNDI name.
no default
Third party

Session JNDI name. When set, takes precedence over other Session settings.

Type
String
Default
none
Defined by
MailProperties
spring.mail.passwordLogin password of the SMTP server.
no default
Third party

Login password of the SMTP server.

Type
String
Default
none
Defined by
MailProperties
spring.mail.portSMTP server port.
no default
Third party

SMTP server port.

Type
Integer
Default
none
Defined by
MailProperties
spring.mail.propertiesAdditional JavaMail Session properties.
no default
Third party

Additional JavaMail Session properties.

Type
Map<String,String>
Default
none
Defined by
MailProperties
spring.mail.protocolProtocol used by the SMTP server.
smtp
Third party

Protocol used by the SMTP server.

Type
String
Default
smtp
Defined by
MailProperties
spring.mail.ssl.bundleSSL bundle name.
no default
Third party

SSL bundle name. If set, 'mail.(protocol).ssl.socketFactory' property is set to an SSLSocketFactory obtained from the corresponding SSL bundle.

Note that the STARTTLS command can use the corresponding SSLSocketFactory, even if the 'mail.(protocol).ssl.enable' property is not set.

Type
String
Default
none
Defined by
MailProperties$Ssl
spring.mail.ssl.enabledWhether to enable SSL support.
false
Third party

Whether to enable SSL support. If enabled, 'mail.(protocol).ssl.enable' property is set to 'true'.

Type
Boolean
Default
false
Defined by
MailProperties$Ssl
spring.mail.ssl.verify-hostnameWhether to enable hostname verification.
true
Third party

Whether to enable hostname verification.

Type
Boolean
Default
true
Defined by
MailProperties$Ssl
spring.mail.test-connectionWhether to test that the mail server is available on startup.
false
Third party

Whether to test that the mail server is available on startup.

Type
Boolean
Default
false
Defined by
MailSenderValidatorAutoConfiguration
spring.mail.usernameLogin user of the SMTP server.
no default
Third party

Login user of the SMTP server.

Type
String
Default
none
Defined by
MailProperties