I have a code that sends mail using the following config. It works on development (windows, java 1.7, grails 2.3.7) but not in production (ubuntu, tomcat7, jdk 1.7)
Anyone has any idea why this works on dev but not in prod? anyway to fix this?
Sidenote: This code used to work, but suddenly it stop working. Don't know what changed.
Config:
grails {
mail {
host = "Outlook.office365.com"
port = 587
username = "username here"
password = "password here"
props = ["mail.smtp.starttls.enable":"true" ,
"mail.smtp.port":"587",
// "mail.debug":"true"
]
}
}
Edit1: Good point in the comments, forgot to include the error. Hope to see some suggestions as fast as the comments! :)
Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: Outlook.office365.com, 587; timeout -1; nested exception is: java.net.UnknownHostException: Outlook.office365.com. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: Outlook.office365.com, 587; timeout -1; nested exception is: java.net.UnknownHostException: Outlook.office365.com