简体   繁体   English

Java - 使用JBOSS / WildFly邮件服务而不是Apache Commons Email发送邮件有什么好处吗?

[英]Java - is there any advantage sending mail using JBOSS/WildFly mail service rather than Apache Commons Email?

right now to send emails from our application we use Apache Commons Email . 现在我们使用Apache Commons Email从我们的应用程序发送电子邮件 I discovered that there is also a possibility to send mails through JBOSS (we use AS6 and WF8). 我发现也有可能通过JBOSS发送邮件 (我们使用AS6和WF8)。 In our app we alwyas use clients SMTP servers, we store the connections parameters (host, username, password, port, SSL/TLS config) in the database. 在我们的应用程序中,我们使用客户端SMTP服务器,我们将连接参数(主机,用户名,密码,端口,SSL / TLS配置)存储在数据库中。 Then Apache Commons uses this param to send emails. 然后Apache Commons使用此参数发送电子邮件。 The app uses Spring for DI. 该应用程序使用Spring进行DI。

Is there any advantage using the "JBOSS way" rather than Apache Commons Email? 使用“JBOSS方式”而不是Apache Commons Email是否有任何优势?

In my opinion advantage is that the password, login and host is setted up in server container and you can easy deploy the same package on different environments with different SMTP settings without additional configuration. 在我看来,优点是密码,登录和主机都设置在服务器容器中,您可以轻松地在不同的环境中使用不同的SMTP设置部署相同的包,而无需额外配置。 SMTP configuration is independent from application. SMTP配置独立于应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM