Mail link grails denied

It seems I tried mail in the way his docs spoke, but still I get:

Error 500: Executing action [x] of controller [x] caused exception: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP 

I use Google apps for my email - me@dogself.com uses gmail. I cannot get grails to send a test message in my dev block (win 7).

my config:

   host = "smtp.gmail.com"
   port = 465
   username = "autoresponse@dogself.com"
   password = "x"
   props = ["mail.smtp.auth":"true",
            "mail.smtp.debug":"true",
            "mail.smtp.starttls.enable":"true",
            "mail.smtp.socketFactory.port":"465",
            "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
            "mail.smtp.socketFactory.fallback":"false"]

change i need to have some kind of signed key to support ssl connection for gmail?

+3
source share
4 answers

Try the following:

props = ["mail.transport.protocol":"smtps",
         "mail.smtps.host":"smtp.gmail.com",
         "mail.smtps.port":"465",
         "mail.smtps.auth":"true"]

, , SMTP- Google. - smtps smtp plus TLS.

+3

Grails Mail . Gmail -.

0

, :

mail.smtp.starttls.enable: "true"

.

0

"":

"mail.smtp.starttls.enable":"true" , TLS .

"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory" .

The port you specified (465) can work with it, but it is usually used for encryption. If the server supports it, I would suggest using the first property "mail.smtp.starttls.enable":"true"and increasing it with "mail.smtp.starttls.required":"true", to make sure your messages are encrypted between your application and the SMTP server and delete "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory"

0
source

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


All Articles