GithubHelp home page GithubHelp logo

Comments (9)

sbglasius avatar sbglasius commented on August 27, 2024 1

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.

sbglasius avatar sbglasius commented on August 27, 2024

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.

ujjwol05 avatar ujjwol05 commented on August 27, 2024

@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.

sbglasius avatar sbglasius commented on August 27, 2024

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.

ujjwol05 avatar ujjwol05 commented on August 27, 2024

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.

sbglasius avatar sbglasius commented on August 27, 2024

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.

ujjwol05 avatar ujjwol05 commented on August 27, 2024

@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.

sbglasius avatar sbglasius commented on August 27, 2024

I used Grails 3.2.3

from grails-mail.

ujjwol05 avatar ujjwol05 commented on August 27, 2024

Thanks . It worked on other grails version . But there is a issue for 3.1.0

from grails-mail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.