Reputation: 1207
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 = "[email protected]"
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.
Upvotes: 1
Views: 2022
Reputation: 62
These settings are for Gmail (just change username/password):
grails.mail.from = "First Last <[email protected]>"
grails.mail.host = "smtp.gmail.com"
grails.mail.port = "465"
grails.mail.username = "[email protected]"
grails.mail.password = "xxx-password-xxx"
grails.mail.props = ["mail.smtp.auth": "true",
"mail.smtp.socketFactory.port": "465",
"mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback": "false",
"mail.smtp.starttls.enable": "true",
"mail.debug": "true"]
Upvotes: -2
Reputation: 3723
It is clearly stated what's wrong:
javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
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 .
Upvotes: 3