0
votes

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
1
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example. - Joe C
Doesn't work isn't a working problem description. - GhostCat
@JoeC good observations! Any suggestions? - Alex Vargas
@GhostCat good observation! Any suggestion? - Alex Vargas
Not really :-|... But maybe that message will ring a bell somewhere. The typical thing when dealing with different systems: are you sure that there are no firewall or other network issues? Can the Linux box talk to that host in general? - GhostCat

1 Answers

0
votes

Ok guys, after struggling for some time, I found out that the damn dns changed.....

After changing the dns and a restart it went back to normal again.

Thank you for your advice and following up the question.

(Tried to telnet with no response whatsoever. Check dns and tried to ping with no response whatsoever. Couldn't even ping stackoverflow. Changed to some other dns. Restart.)