Changing mail configuration in runtime

后端 未结 1 1928
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 05:37

I\'ve just started to investigate grails framework and first task I\'m trying to resolve is sending email. Basic tutorial and community answers provided lot of information f

相关标签:
1条回答
  • 2020-12-07 06:04

    Fixed using re-init mailsender instance but waiting for other solutions, Thanks

    mailSender.setHost("smtp.gmail.com")
    mailSender.setPort(465)
    mailSender.setJavaMailProperties(new Properties() {
        {
            put("mail.smtp.auth", "true");
            put("mail.smtp.socketFactory.port", "465");
            put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
            put("mail.smtp.socketFactory.fallback", "false");
        }
    })
    
    0 讨论(0)
提交回复
热议问题