专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Ruby/Rails

请问 :grails mail发送失败 或给个详细例子

发布时间:2011-06-29 18:43:28 文章来源:www.iduyao.cn 采编人员:星星草
请教 :grails mail发送失败 或给个详细例子
我的代码

Config.groovy配置
grails {
  mail {
  host = "smtp.qq.com"
  port = 465
  username = "**********@qq.com"
  password = "***********"
  props = ["mail.smtp.auth":"true",
  "mail.smtp.socketFactory.port":"465",
  "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
  "mail.smtp.socketFactory.fallback":"false"] }
}


MailController 

package mail
import org.grails.mail.MailService

class MailController {

  def mailService

  def mailNotice = {
  println("------------------")
 
  mailService.sendMail {
  to "**********@qq.com"
  
  subject "Hello John"
  body 'this is some text'
}

  }


}
我在GSP 页面写了这个 <a href="mailNotice">dd</a> 测试能否发送 

但是不能发送QQ邮箱  

错误代码  

------------------
2010-11-12 12:34:59,625 [http-8080-3] ERROR errors.GrailsExceptionResolver - null
javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:319)
at org.grails.mail.MailService.sendMail(MailService.groovy:63)
at org.grails.mail.MailService.sendMail(MailService.groovy:46)
at org.grails.mail.MailService$sendMail.call(Unknown Source)
at mail.MailController$_closure1.doCall(mail.MailController:11)
at mail.MailController$_closure1.doCall(mail.MailController)
at java.lang.Thread.run(Thread.java:619)

帮忙看看是什么错误 谢谢

------解决方案--------------------
抱歉GRAILS我没接触过。按错误提示看是认证失败。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: