首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

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

2012-03-18 
请教 :grails mail发送失败或给个详细例子我的代码Config.groovy配置grails {mail {host smtp.qq.comp

请教 :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我没接触过。按错误提示看是认证失败。

热点排行