Grails Send Mail not working

I am using Mail Plugin to send email in my grails application. I do like this ...

Config.groovy ----

grails {
 mail {
 host = "smtp.gmail.com"
 port = 465
 username = "example@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 controller ---

class MailController {
  def mailService

  def sendmail = {
mailService.sendMail {     
    to "example@gmail.com"     
    subject "Hello Fred"     
    body 'How are you?' 
  }
  }

When I try to send mail. He throws error

 URI
   /groovypublish/mail/sendmail
 Class
   sun.security.provider.certpath.SunCertPathBuilderException
 Message
   unable to find valid certification path to requested target

If I remove some of the mail props from my config.groovy. Then, after sending mail, my page loads endlessly.

I use localhost: 8080 to send mail. I know the problem is with SSL. But how can I avoid the SSL part.

Please, help...

0
source share
1 answer

. .

0

Source: https://habr.com/ru/post/1763706/


All Articles