Comments (11)
It seems like the issue is with mail configurations i.e.
props: [
'mail.smtp.auth' : true,
'mail.smtp.socketFactory.port' : 465,
'mail.smtp.socketFactory.class' : 'javax.net.ssl.SSLSocketFactory',
'mail.smtp.socketFactory.fallback': 'false'
]
is transformed into
props: [ mail: [ smtp: [ auth : true, socketFactory: [ port:465, class: 'javax.net.ssl.SSLSocketFactory', fallback: 'false' ] ] ] ]
For now I've implemented a workaround in Mail plugin https://github.com/puneetbehl/grails3mail-plugin/blob/master/src/main/groovy/grails/plugins/mail/MailGrailsPlugin.groovy
from grails-mail.
This is related to grails/grails-core#634.
from grails-mail.
@jeffbrown I've made workaround in Mail plugin so that we are able send emails. Please click here to see my changes
puneetbehl@caa3340. I've already submitted a pull request fixing this issue, Let me know if I need to change anything in my workaround. I know that this is a temporary fix. But,I was also working on migrating the grails-asynchronous-mail plugin to Grails3 and my version will not work unless the mail plugin works as well.
But I also like the idea about the separate plugin to fix this issue until the grails/grails-core#634. issue is fixed.
Waiting to hear from you.
from grails-mail.
Running into the same thing. I tried to work around this by configuring my own JavaMailSender but the plugin always creates it own. I also added an application.groovy to attempt to use my old config from the 2.3.11 app I am converting, but that gives the same problem. I realize this is probably a larger grails-core issue, but wanted to document some of the attempted work arounds for others.
from grails-mail.
Was able to work around this without having to modify the plugin nor build a plugin that runs before the mail plugin. I just added a listener when the application context was setup and fixed the bean.
@Component
class MailConfig implements ApplicationListener<ContextRefreshedEvent> {
@Override
void onApplicationEvent(ContextRefreshedEvent event) {
Properties props = new Properties();
props.setProperty("mail.smtp.auth", "true")
props.setProperty("mail.smtp.socketFactory.port", "465")
props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory")
props.setProperty("mail.smtp.socketFactory.fallback", "false")
JavaMailSenderImpl mailSender = event.applicationContext.getBean("mailSender")
mailSender.javaMailProperties = props
}
}
from grails-mail.
@bbooth Thanks for the work around! Where did you have to put the MailConfig.groovy source code file? Did you have to adapt the ComponentScan somewhere. We tried to put it in src/main/groovy/ but it was not picked up when starting the Grails application with bootRun.
from grails-mail.
I added it to my application.yml
grails:
mail:
host: smtpout.secureserver.net
port: 465
username: my-username
password: my-password
default:
from: [email protected]
from grails-mail.
Not fixed on Grails 3.0.2 although grails/grails-core#634 was fixed
from grails-mail.
This bug is fixed on grails 3.0.1 ?
from grails-mail.
Solved and working on Grails 3.0.1 with 2.0.0.RC2 !
from grails-mail.
@felansu Thanks for the feedback.
from grails-mail.
Related Issues (20)
- Application-wide rendering side effects caused by incorrect usage of WrappedResponseHolder HOT 2
- IllegalStateException: Not in multipart mode HOT 2
- No signature of method: myController.mutipart() is applicable for argument types: (java.lang.Boolean) values: [true] HOT 2
- Could not locate mail body /email/JobFail. Is it in a plugin? If so you must pass the plugin name in the [plugin] variable HOT 3
- JDK 10 IllegalArgumentException due to ordering of ThreadPoolExecutor setting
- Grails 3.3.4 Boot Issue HOT 1
- Documetation Issues with Multipart HOT 1
- 'to' value limit? send multiple emails HOT 1
- Grails 4 M1, OpenJDK 11.0.2 throws exception with basic usage HOT 9
- Support for External Credentials Provider
- Intellij IDEA: "default" is a Groovy 3.0 keyword HOT 2
- org.grails.plugins:mail:3.0.0 failed when adding grails { pathingJar = true } HOT 6
- Update Documentation
- Grails 4.0.3: <g:applyLayout>: Unable to resolve view HOT 1
- How to send a conference invitation email?
- GrailsMailException: message has no content, use text(), html() or body() methods to set content HOT 1
- Authentication support via OAuth2 for Gmail/Microsoft mail in addition to basic authentication HOT 2
- links to user guide are broken
- Support for smtp connection pool
- Did i miss something ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grails-mail.