Foros de discusión

Could not connect to SMTP host: localhost, port: 25

CM Siau, modificado hace 12 años.

Could not connect to SMTP host: localhost, port: 25

New Member Mensajes: 12 Fecha de incorporación: 17/11/11 Mensajes recientes
Dear Sir/Mdm,

I have encountered exception when application sending test mail :

10:15:18,881 ERROR [MailEngine:489] Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused))
10:15:18,884 ERROR [MailEngine:154] java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
at javax.mail.Service.connect(Service.java:231)
at javax.mail.Service.connect(Service.java:85)
at javax.mail.Service.connect(Service.java:70)
at javax.mail.Transport.send(Transport.java:94)
at javax.mail.Transport.send(Transport.java:48)
at com.liferay.util.mail.MailEngine._send(MailEngine.java:475)
at com.liferay.util.mail.MailEngine.send(MailEngine.java:366)
at com.liferay.util.mail.MailEngine.send(MailEngine.java:110)
at com.liferay.mail.messaging.MailMessageListener.doMailMessage(MailMessageListener.java:101)
at com.liferay.mail.messaging.MailMessageListener.doReceive(MailMessageListener.java:115)

I have configured mail server ip (not using gmail) and port in the Root/ portal-ext.properties. I tried to manual send email using sendmail program in the server is ok but using liferay to send got this exception. I have a dedicated mail server to send out email. I am not sure where is the application pick up the localhost setting. We have changed the mail setting in the liferay admin panel as well. Any liferay master can help ? Thank you so much !
thumbnail
Nagendra Kumar Busam, modificado hace 12 años.

RE: Could not connect to SMTP host: localhost, port: 25

Liferay Master Mensajes: 678 Fecha de incorporación: 7/07/09 Mensajes recientes
java.net.ConnectException: Connection refused


As you are getting following error, here are the options you need to look into

- The port is wrong (CHECK are you sure about SMTP port to which you are trying to connect is the default port i.e., 25)
- Firewall is stopping it
CM Siau, modificado hace 12 años.

RE: Could not connect to SMTP host: localhost, port: 25

New Member Mensajes: 12 Fecha de incorporación: 17/11/11 Mensajes recientes
- smtp port is 25.
- iptables not turn on.
- we can send test email using sendmail
- the mail server IP is configured in the portal-ext.properties

Btw,

From my recent test

i set the host file and add up the mail server IP to point to "localhost" and email sending went through. This just shows that there is some config file besides portal-ext.properties thats points to localhost?