Comments (9)
and by the way, it is not recommended to use closures as action definitions in Grails 2.x and up. You should change it to methods instead.
from grails-mail.
It says, that it fails to connect to smtp.gmail.com
on port 465
. This is not a but in the mail plugin, but rather some connection issue on your localhost.
from grails-mail.
@sbglasius well I have another project that uses mail 1.0.7 on grails 2.4.2 and it's working fine.
mail-2.0.0.RC6 on grails 3.1.0 gives me the error on the same config
from grails-mail.
You should try and convert your mail settings to application.groovy
and use the old format. I'm not sure that the props:
section gets passed back to the mail plugin correctly using application.yml
from grails-mail.
I even tried that one too.My config on application.groovy
grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "*********@gmail.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"]
}
}
And the error is same
ERROR org.grails.web.errors.GrailsExceptionResolver - MessagingException occurred when processing request: [GET] /ims/test/create
Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1. Stacktrace follows:
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
at grails.plugins.mail.MailMessageBuilder.sendMessage(MailMessageBuilder.groovy:130) ~[mail-2.0.0.RC6.jar:na]
at grails.plugins.mail.MailService.sendMail(MailService.groovy:53) ~[mail-2.0.0.RC6.jar:na]
at grails.plugins.mail.MailService.sendMail(MailService.groovy:57) ~[mail-2.0.0.RC6.jar:na]
at ims.TestController.create(TestController.groovy:17) ~[main/:na]
at grails.plugin.springsecurity.web.UpdateRequestContextHolderExceptionTranslationFilter.doFilter(UpdateRequestContextHolderExceptionTranslationFilter.groovy:64) ~[spring-security-core-3.1.1.jar:na]
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53) ~[spring-security-core-3.1.1.jar:na]
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62) ~[spring-security-core-3.1.1.jar:na]
at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58) ~[spring-security-core-3.1.1.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0]
at java.lang.Thread.run(Thread.java:744) [na:1.8.0]
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2042) ~[javax.mail-1.5.4.jar:1.5.4]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697) ~[javax.mail-1.5.4.jar:1.5.4]
at javax.mail.Service.connect(Service.java:364) ~[javax.mail-api-1.5.4.jar:1.5.4]
... 11 common frames omitted
from grails-mail.
This example works: https://github.com/sbglasius/g3-tour-de-plugin-demo/blob/mail/grails-app/conf/application.groovy (notice, that it's on the tag mail
)
The presentation is here: https://www.youtube.com/watch?v=RuK90qD6RJU
Notice, that the password
in my example is set in an external file.
from grails-mail.
@sbglasius Today i tried the plugin for grails 3.0.2 and everything is working fine. I guess there is a issue for grails 3.1.0 . I tried installing the plugin several times but still the error is same.
Which version of grails did you use for the presentation?
from grails-mail.
I used Grails 3.2.3
from grails-mail.
Thanks . It worked on other grails version . But there is a issue for 3.1.0
from grails-mail.
Related Issues (20)
- 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 3
- links to user guide are broken
- Support for smtp connection pool
- Did i miss something ? HOT 2
- Support for Grails 5 and 6 HOT 1
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.