GWT send mail in development mode mail server problem - java

I am trying to send a mail with gwt and java on the server with the buitin jetty on eclipse but I am getting the following error:
Cannot open and load mail server properties file.
Cannot send email. javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
does someone know what to configure to make it work??

This is not GWT related problem. Test you email sending code in isolation (without GWT and Jetty).
Start with sample code and configure it's parameters to your need. You will also need to use a SMTP server to send emails this way.

Related

Java.net.SocketException: Permission denied: connect in Pentaho Data Integration

I try to send an e-mail with the help of Pentaho, but something blocks my shipment. Can anyone help me? I get in the log:
2019/04/02 14:35:29 - Mail - ERROR (version 8.1.0.0-365, build 8.1.0.0-365 from 2018-04-30 09.42.24 by buildguy) : Problem while sending message: javax.mail.MessagingException: Could not connect to SMTP host: smtp..., port: 25;
nested exception is:
java.net.SocketException: Permission denied: connect
I have marked:
Use authentication? true
Use secure authentication? true
Secure connection type: TLS
There's a problem with connecting to the mail server. You need to either double check your connection info, or you need to configure your mail server to work with Pentaho. For example, if you're trying to use Pentaho with Gmail, you need to set Gmail to "allow connections from less secure applications".

Failed to connect to a valid mail server in liferay

I implement a mail service which works fine with local machine(liferay 6.1 with tomcat).
But when I deploy mail service into server(liferay 6.1 with webSphere server on Linux machine ) It wont work
It gives error as
[liferay/scheduler_dispatch-164][MailEngine:560]
Failed to connect to a valid mail server. Please make sure one is properly configured. Could not connect to SMTP host: smtp.gmail.com, port: 465
Please suggest any solution

Remote host closed connection during handshake exception while sending out mail using Java Mail

I am using Java Mail API Ver. 1.4.2 for sending out email in JSF 1.2-Spring based Web Application. I am using non secured SMTP connection for sending out a mail. This email configuration is working fine standalone. Also verified this utility using JUnit 4 test and I am able to send mail using non secure connection.
When I integrate this email module with main web application I am getting following exception at runtime while sending out a mail.
javax.mail.MessagingException: Exception reading response; nested exception is: javax.net.ssl.SSLHandshakeException: Remote host closed
connection during handshake at
com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1764)
at
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1523)
at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:453)
at javax.mail.Service.connect(Service.java:317) at
javax.mail.Service.connect(Service.java:176) at
javax.mail.Service.connect(Service.java:125) at
javax.mail.Transport.send0(Transport.java:194) at
javax.mail.Transport.send(Transport.java:124)
Verified this email module using secure SMTP connection and it's working fine.
Anyone having idea on this issue? Why non-secured SMTP connection not working in integration with Web Application?
I am using email module for both secured and non secured connections.
In that following property was causing the issue : props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
Removed this property for non secured connections and now my non-secured SMTP connection is working in integration with Web Application.

Failed sending email with java program via smtp and ssl

I am just trying to send an email form java code. But I am getting exception like this:
"java.lang.RuntimeException: javax.mail.MessagingException:
Could not connect to SMTP host:smtp.gmail.com, port: 465, response: -1."
I have set the following properties:
mail.smtp.host
mail.smtp.socketFactory.port
mail.smtp.auth
mail.smtp.port
What is the reason for this exception?
Please help me. Thanks in advance.
You could probably try this example to sort it out problem -
Java send mail through gmail
Looks like you haven't found the JavaMail FAQ. These entries might help:
How do I debug problems connecting to my mail server?
How do I configure JavaMail to work through my proxy server?

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