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.

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property 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.

    Copy Configuration Property 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'.

    Copy Configuration Property How can I configure this property?

  • spring.mail.ssl.verify-hostname=true
  • Whether to enable hostname verification.

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?

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

    Copy Configuration Property How can I configure this property?