File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes SMTP Connection Refused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "SMTP Connection Refused" Watch "SMTP Connection Refused" New topic
Author

SMTP Connection Refused

Jawed Nazar Ali
Greenhorn

Joined: Feb 10, 2004
Posts: 15
Hello,

When I am sending mails from my website and I get the following error message:
-------------------------------------------------------------
Could not connect to SMTP host: mail.sdfpak.org,
port: 25;
nested exception is:
java.net.ConnectException: Connection refused
javax.mail.MessagingException: Could not connect to
SMTP host: mail.sdfpak.org, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:695)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:168)
at
javax.mail.Service.connect(Service.java:227)
at
javax.mail.Service.connect(Service.java:131)
.
.
.
.
-------------------------------------------------------------

One thing is worth noting that I can send emails from my local machine using same smtp server after authenticating the server. But SMTP connections are refused on the machine where I have hosted the website.

Any ideas how to solve this problem or what is causing it?


regards,
Jawed Nazar Ali


Jawed Nazar Ali<br /><a href="http://www.jawed.info" target="_blank" rel="nofollow">http://www.jawed.info</a>
Jared Richardson
author
Ranch Hand

Joined: Jun 22, 2005
Posts: 113
You mentioned two different machines. Sounds like your ISP only accepts connections from their customer machines. Your website box is hosted by a different ISP, correct? This type of limitation is set up to foil spammers.

Does your website ISP have a mail server you can use?


Check out <b>Ship It! A Practical Guide to Shipping Software</b><br /> <br /><a href="http://www.pragmaticprogrammer.com/titles/prj/" target="_blank" rel="nofollow">http://www.pragmaticprogrammer.com/titles/prj/</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SMTP Connection Refused
 
Similar Threads
how to solve Below error?
SMTP Connection
javaMail
Tomcat fails to send e-mail
Could not connect to SMTP host: localhost, port: 25