MailSenderConfig

@Configuration
@EnableConfigurationProperties(value = [MailProperties::class])
open class MailSenderConfig

Provides a JavaMailSender bean if Spring Boot's auto-configuration does not create one (for example, when no spring.mail.* properties are defined). This keeps EmailService autowirable in all environments. Values from MailProperties will be applied when present.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
@Bean
@Primary
@ConditionalOnMissingBean(value = [JavaMailSender::class])
open fun javaMailSender(mailProperties: MailProperties): JavaMailSender