gpc / grails-mail

The Grails Mail Plugin
http://grails.org/plugin/mail
Apache License 2.0
45 stars 85 forks source link

How to use different smtp for different emails? #37

Closed minhajkk closed 2 years ago

minhajkk commented 7 years ago

For example we've a specific email which should be sent through ses and some emails through mandrill. I've tried following code but getting error:

def config = grailsApplication.config
config.mail.host = "smtp.mandrillapp.com"
config.mail.username = "username.com"
config.mail.password = "passwordkey"

mailService.sendMail config, {
    to ...
    replyTo grailsApplication.config.grails.mail.default.replyTo
    subject ...
    html view: "/emailTemplate", model: []
}

Error :


org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: [EOF]. Failed messages: javax.mail.MessagingException: [EOF]; message exceptions (1) are:
Failed message 1: javax.mail.MessagingException: [EOF]```
angelique360 commented 6 years ago

I have the same problem,

angelique360 commented 6 years ago

check this: https://www.stepwise.pl/blog/grails3-multiple-smtp-servers/