Spring Boot 邮件配置

########################################################

spring boot mail tls

########################################################

# 设置邮箱主机

spring.mail.host=smtp.qq.com

# 设置用户名

spring.mail.username=用户名

# 设置密码

spring.mail.password=密码

# 设置是否需要认证,如果为true,那么用户名和密码就必须的,

#如果设置false,可以不设置用户名和密码,当然也得看你的对接的平台是否支持无密码进行访问的。

spring.mail.properties.mail.smtp.auth=true

# STARTTLS[1]  是对纯文本通信协议的扩展。它提供一种方式将纯文本连接升级为加密连接(TLS或SSL),而不是另外使用一个端口作加密通信。

spring.mail.properties.mail.smtp.starttls.enable=true

spring.mail.properties.mail.smtp.starttls.required=true

########################################################

spring boot mail ssl

########################################################

spring:
    mail:
        host: smtp.exmail.qq.com
        username: [email protected]
        password: password
        port: 465
        properties:
            mail:
                smtp:
                    auth: true
                    ssl:
                        enable: true

猜你喜欢

转载自www.cnblogs.com/jtlgb/p/9207677.html