Keycloak with Outlook SMTP Server Failed to send email - java

I have keycloak on an Azure Virtual Machine, and until a few weeks ago everything went normal, but for some storage problems I had to restart the server. After that, I can't test the SMTP connection at the Email tab.
If I look the logs, I see:
2022-05-20 00:14:47,313 ERROR [org.keycloak.services] (default task-3568) KC-SERVICES0029: Failed to send email: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: 127.0.0.1, 25; timeout 10000;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2210)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:722)
at javax.mail.Service.connect(Service.java:342)
at javax.mail.Service.connect(Service.java:222)
at javax.mail.Service.connect(Service.java:171)
at org.keycloak.email.DefaultEmailSenderProvider.send(DefaultEmailSenderProvider.java:148)
...

Related

Send mail with own host in google cloud server

I have my own smtp host. like, mail.xxx.com. and my application is host on Google Cloud Server. now when i send mail then it's give this type of error.
DEBUG SMTP:
useEhlo true, useAuth trueDEBUG SMTP: trying to connect to host "mail.xxx.com", port 587, isSSL falseorg.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException:
Could not connect to SMTP host: mail.xxx.com, port: 587;
nested exception is: java.net.ConnectException: Connection refused (Connection refused).
Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: mail.xxx.com, port: 587;
Mail Configuration Properties ::
mail.config.smtp.host=mail.xxx.com
mail.config.smtp.port=587
mail.config.smtp.username=noreply#xxx.com
mail.config.smtp.password=xxx
mail.config.smtp.auth=true
mail.config.smtp.starttls.enable=true
If anyone face this type of error and got the solution then please guide me.

Amazon SES Connection

I am trying to use Amazon SES mail service. I have configured settings properly, and with the credentials it is working in one of our network machine, but in other it is not working, alwayz gives ConnectException
javax.mail.MessagingException: Could not connect to SMTP host: email-smtp.us-east-1.amazonaws.com, port: 25;nested exception is:java.net.ConnectException: Connection refused: connect
Check your security groups and make sure SMTP port is open to this network or device.

javax.mail.MessagingException: Could not connect to SMTP host: smtp.live.com, port: 587

I've implemented a code that sends e-mails using Outlook server (worked fine locally).
What's the cause of the following exception on my production environment and how do I resolve it?
javax.mail.MessagingException: Could not connect to SMTP host: smtp.live.com, port: 587; nested exception is: java.net.ConnectException: Connection timed out

ActiveMQ, Broker Url: how to run on port number other than default 61616

I am trying to run on the port number 5000, tcp://localhost:5000
it shows the following error
WARNING: Could not refresh JMS Connection for destination 'queue://jmsExample' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://localhost:5000. Reason: java.net.ConnectException: Connection refused: connect
Any Help please
The port 5000 is already in use by another process or service

Java Mail Error : java.net.ConnectException: Connection refused: connect

I am stuck with the mail sending with Java Mail API.
I am not able to connect SMTP server with any kind of properties... I have tried with different combination.
I am connecting SMTP Remote server (Server is not at localhost, its in LAN), with port 25 but it gives me the port error to 465, I dont know why ?
javax.mail.MessagingException: Could not connect to SMTP host: *RemoteIP*, port: 465; nested exception is: java.net.ConnectException: Connection refused: connect
If anyone can help.
Thankx in advance.
Maybe your mail server is actually using SMTPS on port 465 (although it's not the recommended port). If that is the case you can see here an example of using JavaMail with SMTPS. Note the property mail.smtps.host; you also have the mail.smtps.port property to specify 465.

Categories