javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25;

前端 未结 2 1456
余生分开走
余生分开走 2020-11-29 06:31

The Code I\'m Using to send a simple mail

import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.io.*;
import javax.activation.Da         


        
相关标签:
2条回答
  • 2020-11-29 06:36

    Sounds like a firewall problem (firewalls silently drop packets that are not allowed, which is why you would be seeing a Connection Timeout.

    Can you try

    H:\> telnet smtp.gmail.com 25
    Connecting To smtp.gmail.com...Could not open connection to the host, on port 25
    : Connect failed
    

    on your server and see whether you get a connection? (I'm behind a firewall here that does not allow connections to gmail)

    0 讨论(0)
  • 2020-11-29 06:53

    While running in jboss check whether your running using run.bat -b 0.0.0.0.

    If not try and it should work fine.

    0 讨论(0)
提交回复
热议问题