Sending Email - Default

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-encoding=UTF-8
  • Default MimeMessage encoding.

    How can I configure this property?

  • spring.mail.host=
  • SMTP server host. For instance, 'smtp.example.com'.

    How can I configure this property?

  • spring.mail.jndi-name=
  • Session JNDI name. When set, takes precedence over other Session settings.

    How can I configure this property?

  • spring.mail.password=
  • Login password of the SMTP server.

    How can I configure this property?

  • spring.mail.port=
  • SMTP server port.

    How can I configure this property?

  • spring.mail.properties=
  • Additional JavaMail Session properties.

    How can I configure this property?

  • spring.mail.protocol=smtp
  • Protocol used by the SMTP server.

    How can I configure this property?

  • spring.mail.ssl.bundle=
  • 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.

    How can I configure this property?

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

    How can I configure this property?

  • spring.mail.test-connection=false
  • Whether to test that the mail server is available on startup.

    How can I configure this property?

  • spring.mail.username=
  • Login user of the SMTP server.

    How can I configure this property?