Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jhonatasfender/a2d474c37579f021af8ec06130977740 to your computer and use it in GitHub Desktop.
Save jhonatasfender/a2d474c37579f021af8ec06130977740 to your computer and use it in GitHub Desktop.
spring boot gmail email setup that worked
spring.mail.host=smtp.gmail.com
spring.mail.port=465
spring.mail.username=xxxx@gmail.com
spring.mail.password=xxxx xxxx xxxx xxxx
# Other properties
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.connectiontimeout=5000
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.writetimeout=5000
# TLS , port 587
#spring.mail.properties.mail.smtp.starttls.enable=true
# SSL, post 465
spring.mail.properties.mail.smtp.socketFactory.port = 465
spring.mail.properties.mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
# https://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/
# https://www.mkyong.com/spring-boot/spring-boot-how-to-send-email-via-smtp/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment