Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

smtp with hotmail

Posted on 2000-02-19
20
Medium Priority
?
1,877 Views
Last Modified: 2012-06-27
  I'm developing an smtp client in 100% base java. (ie no java mail stuff used) Right now it works with only some smtp servers.  
   It must however, work with hotmail since many people use hotmail.  When the clients hits hotmail the connection nevers opens right.  Here is my test code:


import java.net.*;
import java.io.*;
import java.util.*;

public class Test
{
   public static void main(String[] args)
   {      
        DataInputStream reply = null;
        PrintStream send = null;
        Socket sock = null;
      String rstr = null;

        try
        {
System.out.println("try to connect");
           sock = new Socket( "hotmail.com", 25 );
System.out.println("conected");
           reply = new DataInputStream( sock.getInputStream() );
System.out.println("got a data input stream - try output stream");
           send = new PrintStream( sock.getOutputStream() );
System.out.println("got a data output stream - try reading stream");
           rstr = reply.readLine();
System.out.println("read: " + rstr);
        }
      catch (UnknownHostException x1)
      {
         System.out.println("Failed to find host - hotmail.com");
         System.out.println(x1.getMessage());
      }
      catch (IOException x3)
      {
         System.out.println("Error reading / writing to socket on hotmail.com");
         System.out.println(x3.getMessage());
      }

   }
}

running this I get:
try to connect
Error reading / writing to socket on hotmail.com
connect

   So right now I know the line:

   sock = new Socket( "hotmail.com", 25 );

never does return since the println after it does not appear on the screen.

My question is why? and how can I fix this.


0
Comment
Question by:calvinrsmith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 4
  • +3
20 Comments
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2539455

What is the exception message U have got??
0
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2539457

Oh!!!!. Sorry. Ignore my previous comment.

I think hotmail is not allowing to u to listen on that port.

It may be their security issue ( I think)

0
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2539458

replace listen  with connect in my previous comment..
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 16

Expert Comment

by:heyhey_
ID: 2539629
Hotmail gives you HTML interface to your e-mail account, but it DOES NOT SUPPORT SMTP.
0
 
LVL 6

Expert Comment

by:gadio
ID: 2539716
The reason that many companies (including hotmail) will not let you use SMTP protocol is porbably because of SPAM mail (unsolicited mail) that would be sent through them. You, of cause, are not going to do that.... If you want to send mail, use your company's mail server or any other server of a company that knows you and trusts you. When you have such a server you can send email to anyone (as well as to people that have a hotmail account).
0
 
LVL 1

Author Comment

by:calvinrsmith
ID: 2539906
  When mail is sent to a company's email server, then the company email server must forward it to hotmail, right?  
   This must true or no mail ever arrives to hotmail users.  
   So, how does the company's email server send the mail to hotmail if not by smtp?
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2539923
SMTP messages are (probably) handled from mail.hotmail.com or some other  server (hint 'DNS RFC')
0
 
LVL 6

Expert Comment

by:gadio
ID: 2539943
As far as I remember, there is a different protocol for messages exchange between email servers, and its not SMTP.
0
 
LVL 1

Author Comment

by:calvinrsmith
ID: 2539959
anyone know what it is?
0
 
LVL 1

Author Comment

by:calvinrsmith
ID: 2540104
side note - port 25 gives me: connect
other ports give me: Operation times out
so there is something diferent with port 25 - the smtp port
0
 
LVL 3

Expert Comment

by:daitt
ID: 2540987
The server is "mail.hotmail.com" port 25, not "hotmail.com". The protocol is ESMTP (Extended SMTP). Initially defined in RFC 1869 and extended thereafter.
daitt
0
 
LVL 1

Author Comment

by:calvinrsmith
ID: 2541002
daitt: I modified my original program, listed above, to use mail.hotmail.com - port 25, and am getting the same results.
0
 
LVL 3

Expert Comment

by:daitt
ID: 2541012
Some extension: RFC 1651, RFC 1652, RFC 1653:

http://slug.ctv.es/mirror/rfc/16xx/
http://www.tac.nyc.ny.us/mail/rfc-index.html

I only know that ESMTP provides some notification features and the first command sent from the client is EHLO, not HELO.
Good luck
daitt

0
 
LVL 3

Expert Comment

by:daitt
ID: 2541031
You can check your internet connection .. I think the command is :
telnet mail.hotmail.com 25
It will open a connection to mail.hotmail.com port 25.
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2541522
telnet mail.hotmail.com 25
does not work for me too.


0
 
LVL 3

Accepted Solution

by:
daitt earned 600 total points
ID: 2541696
It means you cannot connect to mail.hotmail.com port 25. Telnet opens a raw connection and simply echo what it received and send what you typed. I connected to mail.hotmail.com port 25 and the result was:

220-HotMail (NO UCE) ESMTP server ready at Mon Feb 21 01:10:26 2000
220 ESMTP spoken here

Then I tried to type the command HELO 127.0.0.1 1234 and the result was:

250 Requested mail action okay, completed

I think SMTP was working on the host. So if you couldn't connect to mail.hotmail.com port 25, you can contact your network administrator.
0
 
LVL 7

Expert Comment

by:vladi21
ID: 2541843
also they use or have used
Protocol: HTTPMail
Server: http://services.msn.com/svcs/hotmail/httpmail.asp
....
0
 
LVL 1

Author Comment

by:calvinrsmith
ID: 2571461
vladi21, can you explain how that link works?  when i load it it asks me to loginm which I do, then it displays:

Internal Server Error
Oops! The server encountered an internal error and was unable to complete your request.
Please contact our server administrators and inform them of the time the error occurred and what activity you might have been performing just prior to receiving this error.


I assume this is because no paramters are passed to the web site.

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2571876
mail.hotmail.com:25 is working as SMTP server now :)
0
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2572914
what a explosion by heyhey!!!

:) :) :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question