This is example of implementation of sending email using Spring Boot and Angus mail with write timeout configuration using custom ScheduledThreadPoolExecutor
See the class com.ponomarev.outgoing.email.SendEmailWithWriteTimeoutTest
in the test directory:
You can see more details in the article on my blog: https://medium.com/@egorponomarev/my-contribution-to-javamail-and-sending-emails-using-spring-boot-3-a03f814e899c