I can not send e-mail from Java via MS Exchange Server. Common paint for many. solution?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Igor_Artimenko
Posted On:   Thursday, October 18, 2001 02:16 PM

Hi everybody! Here is my code; Transport transport = session.getTransport("smtp"); In the line below I have an exception transport.connect(serverIpAddress,userId,password); ( 12.12.12.12 is a replacement of real host IP): Could not connect to SMTP host: 12.12.12.12, port: 25; nested exception is: java.net.ConnectException: Connection refused: no further information at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:867) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:156) at javax.mail.Service.connect(Service.java:234) at test1.SendMail.sendmail(SendMail.java:182) at test1.SendMail.main(SendMa   More>>

Hi everybody!

Here is my code;

Transport transport = session.getTransport("smtp");

In the line below I have an exception
transport.connect(serverIpAddress,userId,password);

( 12.12.12.12 is a replacement of real host IP):

Could not connect to SMTP host: 12.12.12.12, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: no further information
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:867)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:156)
at javax.mail.Service.connect(Service.java:234)
at test1.SendMail.sendmail(SendMail.java:182)
at test1.SendMail.main(SendMail.java:314)

When I try to telnet to the host. I have reply - Could not open a connection to host: Connect failed

Other ports give me the same I tested connection within for(int port = 1; port < 999, port++)


1. I gess we have port 25 blocked for security reasons. And MS Exchange Server uses his proprietary protocol/way to send messages. What is this protocol/way? Do we need any other *.jar to use with MS Exchange Server?


2. Is any other way to send e-mail via Exchange for example to put it into some output box & Exchange Server will send it by itself?


3. What format of userId should be to use transport.connect?


4. Any other solution?


Igor Artimenko
Java Programmer
Xerox Corp.

   <<Less

Re: I can not send e-mail from Java via MS Exchange Server. Common paint for many. solution?

Posted By:   Scott_Warren  
Posted On:   Thursday, October 18, 2001 03:47 PM

Check in the Managament Console that you have the Internet Mail Connector installed and running the IMC will listen on Port 25 and allow you to use the SMTP protocol.

The API for Exchange is MAPI, SMTP should work fine if you have the IMC installed.

Good Luck + Have Fun

Scott
About | Sitemap | Contact