I have a basic SpringBoot 2.0.5.RELEASE app. Using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.
I've configured the springboot properties as follows:
spring.mail.host=smtp.gmail.com
spring.mail.username=nunet@gmail.com
spring.mail.password=nunet999!
spring.mail.properties.mail.smtp.auth = true
spring.mail.properties.mail.smtp.socketFactory.port = 465
spring.mail.properties.mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.fallback = false
spring.mail.propertirs.mail.smtp.ssl.enable = true
and It is working fine when sending emails. I also have an email address from my domain info@nunet.com
I am using Postfix to forward the Emails from info@nunet.com to to nunet@gmail.com and its working fine.
I would like to know if there is a way to do it on the other way around. Send emails from info@nunet.com but using nunet@gmail.com smtp to avoid to install a Mail server.
or basically I would like to know how to extract the smtp properties from my linux server, because from there I can send emails using the command
cat ~/test_message | mail -s 'Test email subject line' nunet@gmail.com