我已經安裝了this plugin,我想從一個服務/域類方法來發送郵件,我在做這樣的如何從一個域/服務發送郵件的Grails
class TrainingService {
def mailService
public def sendMail() {
mailService.sendMail {
multipart true
to "[email protected]"
subject "Hello,"
body 'How are you?'
}
}
我遇到錯誤「不能調用如何解決這個問題
你在哪裏打電話給sendMail?你是否這樣稱呼它:'trainingService.sendMail()'?你的TrainingService是否定義了:你調用它的'def trainingService'? – Weezle 2012-07-18 22:04:22
我從控制器呼叫trainingService.sendMail() – n92 2012-07-19 07:35:10