Jos Collin-ERS,HCLTech wrote:
> I'm using GNU JavaMail in my program. I'm using a PLAIN SMTP Authentication right now. But my SMTP server is configured to use CRAM-MD5. So I want to know whether GNU JavaMail supports CRAM-MD5 authentication for SMTP.
Yes it does.
If for some reason it keeps falling back to PLAIN, it may be that the server is presenting the authentication mechanisms in the "wrong" order. You can override the order in which authentication mechanisms are attempted by the client by setting the mail.smtp.auth.mechanisms session property (e.g. "mail.smtp.auth.mechanisms=CRAM-MD5,PLAIN,LOGIN"), see the SMTP provider package JavaDoc for more information.