Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes problems running the program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problems running the program" Watch "problems running the program" New topic
Author

problems running the program

jonty rhodes
Greenhorn

Joined: Feb 12, 2004
Posts: 16
I'm a beginner to java. I have written a program that send out email. It compile fine but when i try to run it , it gives me the following exception

This is my program:

Could someone plz help me out with this or point me to the right direction. My ISP is rogers hi speed. They told me hostname of SMTP server was "smtp". When i try "ping smtp" command in DOS. I get the following

I have no idea what that means. Any help or suggestions would be greatly appreciated. THanks
Gabriel White
Ranch Hand

Joined: Mar 02, 2003
Posts: 233
Are you inside a firewall, where your IP gets NAT'd?
Also some smtp servers are behind a DMZ which will not allow you to make ICMP requests to it. You may have to check your mail settings in your mail client, ie outlook, or pine or whatever you are using for pop mail. Double check the smtp server settings. It doesn't make sense that the host name would just be "smtp".
Lemme do some investigation on the rogers domain and see what it is supposed to be.
And according to your error it is still pointing to the smtp server "localhost". This is not good.
as you can see:

javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
[ February 18, 2004: Message edited by: steve.Wysocki ]
Gabriel White
Ranch Hand

Joined: Mar 02, 2003
Posts: 233
Jonty, see if this link refers to your situation. I don't know if you are in london or not.
Rogers email upgrades
Because this mail server : smtp.rogers.com is totally down. You have the correct domain name and the correct smtp server. Your pop server is called pop and your smtp server is called smtp. These are quite ambigous names for a major high speed internet access ISP, but it's what they use.
[ February 18, 2004: Message edited by: steve.Wysocki ]
[ February 18, 2004: Message edited by: steve.Wysocki ]
jonty rhodes
Greenhorn

Joined: Feb 12, 2004
Posts: 16
Hey Steve,
Thanks for the quick response. I'm not behind any firewall. I'm in toronto area so that doesn't affect me. I have double checked my setting and the username and password matches. I don't know what else to do. Any other suggestions??..THanks for your input..
 
 
subject: problems running the program
 
Similar Threads
Sending email from java. Pls Help!!!
how to detect a firewall
Sending an email in JSP
JavaMail and server port on Yahoo
smpt java mail woes