Search code examples
javasmtpsasl

SMTP with CRAM-MD5 in Java


I need to send email through an (external) SMTP server from Java however this server will only accept CRAM-MD5 authentication, which is not supported by JavaMail.

What would be a good way to get these emails to send? (It must be in Java.)


Solution

  • Here is thread which says that you need to add the following property:

    props.put("mail.smtp.auth.mechanisms", "CRAM-MD5")
    

    Also in Geronimo implementation there is CramMD5Authenticator

    Hope it helps to resolve this old question.