0

I have a Java app that sends email via Apache Commons Email. The app works just find on my development environment, but when I deploy it to the server, I'm getting an error that Commons couldn't connect to the email server.

org.apache.commons.mail.EmailException: Sending the email to the following failed : 255.255.255.255 :587 ...Error authenticating with server.

Just to be sure this wasn't my configuration, I've tried on 2 different email providers, 1) Our email company email provider 2) Gmail. Both work on my dev and both fail with the same message on the server.

I've tried several ports and IP combinations. I've turned SSL on and off. I've checked with our email provider. I'm left with a configuration of either the server or the network.

I work remotely so I'm not on the same network as our servers, but I the app works for me even if I am on VPN.

I've used telnet from within the server and I can connect to the email provider on the proper port.

Does anyone have anything else I can try? Thanks.

Edit The error I'm getting is an authentication error. Could there be a security setting to prevent the credentials from being passed?

4

2 回答 2

0

看来我错过了 1 行代码。假设“电子邮件”是我的邮件对象......

email.setSSL(true);

现在一切正常。我不确定为什么它以前不起作用。

于 2012-04-19T16:15:21.903 回答
0

听起来仍然像一个权限问题。1024 以下的端口受到限制。使用 sudo 权限启动您的应用程序。

于 2012-04-16T16:12:39.337 回答