【发布时间】:2019-03-04 03:13:09
【问题描述】:
我有一个基本的 SpringBoot 2.0.5.RELEASE 应用程序。使用 Spring Initializer、JPA、嵌入式 Tomcat、Thymeleaf 模板引擎,并打包为可执行 JAR 文件。
我已将 springboot 属性配置如下:
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
发送电子邮件时它工作正常。我还有一个来自我的域 info@nunet.com 的电子邮件地址
我正在使用 Postfix 将电子邮件从 info@nunet.com 转发到 nunet@gmail.com 并且工作正常。
我想知道是否有其他方法可以做到这一点。从 info@nunet.com 发送电子邮件,但使用 nunet@gmail.com smtp 以避免安装邮件服务器。
或者基本上我想知道如何从我的 linux 服务器中提取 smtp 属性,因为从那里我可以使用命令发送电子邮件
cat ~/test_message | mail -s 'Test email subject line' nunet@gmail.com
【问题讨论】:
-
我没听错吗,你想发送电子邮件扔了 gmail smtp 服务器并使用 nunet.com 发件人地址?
-
是的,也许不可能吧?
-
您在寻找谷歌套件(gsuite.google.com/intl/en_in)吗??
标签: linux spring-boot smtp ubuntu-16.04 postfix-mta