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

前端 未结 2 1469
余生分开走
余生分开走 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)

提交回复
热议问题