grails / grails-mail

The Grails Mail Plugin
https://grails.github.io/grails-mail/
Apache License 2.0
15 stars 25 forks source link

grails3 override username #21

Closed noemiebolo closed 7 years ago

noemiebolo commented 7 years ago

Hello,

I would like to override grails.mail.username and grails.mail.password in the file application-development.yml.

In application.yml : grails: mail: username: user password: pass

In application-development.yml : grails: mail: username: new-user password: new-pass

I expect, in a development mode, to get new-user and new-pass as values but I only get empty strings in mailSender object (from mailService).

Can someone explain me why ? Thanks Noémie

ujjwol05 commented 7 years ago

create a groovy script file named as application.groovy and here is the config : grails { mail { host = "smtp.gmail.com" port = 465 username = "abc@gmail.com" password = "password" props = ["mail.smtp.auth":"true", "mail.smtp.socketFactory.port":"465", "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory", "mail.smtp.socketFactory.fallback":"false"] } }

noemiebolo commented 7 years ago

answer in https://github.com/gpc/grails-mail/issues/36.