I’m trying to send mail from my Grails app with mail plugin. It worked in the development enviroment and for the default settings for gmail smtp. I have now deployed app on Windows server running Tomcat 7 and trying to send mail via Exchange. I am getting this error:
These are mail properties in config.groovy:
grails {
mail {
host = "mail.something.com"
port = 25
username = "app@something.com"
password = "xxx"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"25",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}
javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:590)
at javax.mail.Service.connect(Service.java:291)
at grails.plugin.mail.MailMessageBuilder.sendMessage(MailMessageBuilder.groovy:102)
at grails.plugin.mail.MailMessageBuilder$sendMessage.call(Unknown Source)
at grails.plugin.mail.MailService.sendMail(MailService.groovy:39)
at grails.plugin.mail.MailService$sendMail.call(Unknown Source)
at org.helpdesk.RequestController$_closure12.doCall(RequestController.groovy:240)
at org.helpdesk.RequestController$_closure12.doCall(RequestController.groovy)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
What should I do? Thanks.
It is clearly stated what’s wrong:
Your Gmail SMTP settings won’t work with Exchange server. You need to change settings. Just search for it. Here is one question involving Java Mail and Exchange server: JavaMail Exchange Authentication and you might be interested in this topic in Java Mail FAQ: http://www.oracle.com/technetwork/java/faq-135477.html#Exchange-login .