File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Problem in Sending mail to SMTP port thru Sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Problem in Sending mail to SMTP port thru Sockets " Watch "Problem in Sending mail to SMTP port thru Sockets " New topic
Author

Problem in Sending mail to SMTP port thru Sockets

Neeraj Thakkar
Ranch Hand

Joined: Dec 06, 2000
Posts: 80
Hi Everybody,
I have made a program which accepts a domain name. I then get the InetAddress for that name and try to get connected to the host at port number 25(which is for SMTP) but I am unable to establish a connection between the server and my application except for WWW.USA.NET.
All SMTP mail server listen at port number 25 so when i am trying to connect to this port number why I am not getting response from other mail servers like yahoo or hotmail or rediffmail etc etc.
Can anyone help.


Neeraj Thakkar<br />"Try to get what you like,Else you will be forced to like what you get."
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Any SMTP Server can prevent connections except those that originate from approved IP addresses. Yahoo, Hotmail and quite a few others are probably limited to just their own servers for mail orgination. This prevents you from using them to send mass maillings which can swamp their server for their normal customers.

------------------
Hope This Helps
Carl Trusiak


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Neeraj Thakkar
Ranch Hand

Joined: Dec 06, 2000
Posts: 80
Hi Carl,
Got ur reply but I still have a doubt. As u said that yahoo or rediff accept mail originating from their own server but we are able to send a mail to somebody@yahoo.com from anyother server like rediff netaddress hotmail and so on.
So please help me out.
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Lets see if I can illustrate this.
Y - Your PC
S - Your Smtp server that allows your IP address
H - Hotmail, Yahoo, Rediff Servers
A - Any Server as destination where the email is addressed
These are allowed
Y - Smtp origniation to - S - Stmp to destination - A
Y - Http origination to - H - Stmp to destination - A
Not allowed
Y - Smtp origination to - H
Actually any server can include a feature that will only allow IP addresses that they set to origninate mail.
This is simplifed but, I hope it relays the concpt.
------------------
Hope This Helps
Carl Trusiak
[This message has been edited by Carl Trusiak (edited February 03, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Sending mail to SMTP port thru Sockets
 
Similar Threads
InterruptedIOException
how do i specify the port form where i want to send the mails
How To Open a Port in SunSolaris.
problem in sending mail
Java SMTP Programming