There is an incompatibility between the mailapi artifact within Vaadin and spring-boot-starter-mail. This prevents using both sun.javax mail or using Spring boot mail from within Vaadin (I am using V18).
It is fixed with:
<dependency>
<groupId>com.vaadin</groupId>
<!-- Replace artifactId with vaadin-core to use only free components -->
<artifactId>vaadin</artifactId>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mailapi</artifactId>
</exclusion>
</exclusions>
</dependency>