我已经使用docker image在本地创建了GreenMail服务器。 Spring boot应用程序可以使用服务器通过JavaMailSender
发送一些电子邮件。
config.yml :
spring:
mail:
host: localhost
port: 3025
username: username
password: secret
properties:
mail:
protocol: smtp
smtp:
auth: true
starttls:
enable: true
我想验证本地服务器的电子邮件,所以我希望这样:
localemailserver.getReceivedMessages().length != 0;
如何获取Spring Boot应用程序的已连接电子邮件服务器?