【问题标题】:Mail plugin configuration using Grails 3使用 Grails 3 配置邮件插件
【发布时间】:2016-11-23 12:05:15
【问题描述】:

当我尝试在 grails 中使用邮件插件时遇到问题。我在谷歌搜索的主要是 Grails 版本 2 的邮件插件。

我尝试使用

进行设置

compile 'org.grails.plugins:mail:2.0.0.RC6' 在我的 buildConfig.groovy 中

sendMail {
        to "xxxxxx@gmail.com"
        from "........@yahoo.com"
        subject "This is a test mail"
        text "Hello, This is a test mail, how are you?"
    }

在我的一个控制器功能中

当我尝试运行它时,发生了 MailConnectException。我错过了 grails 3 的任何邮件插件配置吗?还是我必须在此站点http://grails.asia/grails-mail-plugin-example 中的 application.groovy 中添加一些东西,例如 grails 2?

【问题讨论】:

    标签: email grails-3.0


    【解决方案1】:

    我自己想通了,实际上我需要像在 grails 2 中一样将邮件配置放入 application.groovy。MailConnectionException 是由于电子邮件中的高安全性,因此,我所做的就是将其设置为允许应用程序连接到邮件。这在邮件系统的安全选项中可用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-12
      • 1970-01-01
      • 1970-01-01
      • 2014-09-22
      • 2010-10-25
      相关资源
      最近更新 更多