JavaMail with MS Exchange: No authentication mechansims supported by both server and client

前端 未结 6 2156
天命终不由人
天命终不由人 2021-01-12 01:39

I\'ve been trying for days now to send mail from Grails application and unsuccessfully. I\'m using:

  • grails 1.3.7
  • mail 1.0 plugin
  • spring-secur
6条回答
  •  灰色年华
    2021-01-12 02:22

    in my case, I had to set the property

    "mail.smtp.ehlo"
    

    to "false"

    (in addition to adding to setting the property "mail.smtp.auth" to "false" which however seems to be the default according to this link)

    Before setting "mail.smtp.ehlo" to "false" I saw the following debug output (enabled by setting the property "mail.debug" to "true"):

    DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM 
    DEBUG SMTP: mechanism LOGIN not supported by server
    DEBUG SMTP: mechanism PLAIN not supported by server
    DEBUG SMTP: mechanism DIGEST-MD5 not supported by server
    DEBUG SMTP: mechanism NTLM not supported by server
    

    and then getting the same javax.mail.AuthenticationFailedException.

    (in this case, the SMTP server was a Microsoft one)

提交回复
热议问题