jQuery in Action, 3rd edition
The moose likes Other JSE/JEE APIs and the fly likes smtp server error in javamail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "smtp server error in javamail" Watch "smtp server error in javamail" New topic

smtp server error in javamail

Parag Mokal

Joined: Jan 14, 2001
Posts: 19
I'm working on Win98 and I tried to run the MailExample.java given in JavaMail tutorial at java.sun.com. In this example it sets up the mail server as follows:

Properties props=System.getProperties();
props.put("mail.smtp.host", "SMTP.Server");

The program compiles, but when I try to run the program I get the following error
Unknown SMTP host : SMTP.Server
Does this program require an SMTP server. If so, can I get it for win98. I tried to search for the server, but I get different softwares which work just like Outlook Express. It would be very heplful if someone tells me a particular site from where I can download a free SMTP server for win98.
John Wetherbie

Joined: Apr 05, 2000
Posts: 1449
I don't know much about Windows. I'm really a Unix guy, I just have have an NT box on my desk. Regarding SMTP, it is pretty standard to have on Unix boxes but I'm not sure it would be on Windows.
Have you done a web search to try and track down SMTP servers for Windows? There may be some out there.

The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
Parag Mokal

Joined: Jan 14, 2001
Posts: 19
hi John,
Thank you for your reply. But I would like to ask you about Unix. I will try getting unix. Can you give me some links which describe unix installation and tutorials on it.
David Rocks
Ranch Hand

Joined: Apr 24, 2001
Posts: 162
I got a mail server from www.freeware.com called first class mail server which runs on all windows machines. search for mail server and it comes up.
it is really good for a cut down free version. create a new domain called mail.host in the app and in your prog put in.
properties.put( "mail.host" , "mail.host" ) ;
took me ages to work out that you needed a mail server. got lucky with first class mai server which is simple to run.
John Wetherbie

Joined: Apr 05, 2000
Posts: 1449
Unix runs on Unix boxes like those from Sun, HP, etc. If you have a Windows box you can get a Solaris (Sun's Unix) version for it for $80 US or you can install Linux.
As David mentioned there is at least one free mail server you can use for Windows and I'm sure there are others if you search the web for them.
Good luck!
Anup Agrawal

Joined: Jun 09, 2001
Posts: 19
Dear David,
Is it first class mail server. Or first Up mail server
Sridhar PBV

Joined: Aug 01, 2001
Posts: 1
Hi David/Guys,
I have done exactly what david has said previuosly. Compilation of MailExample.java was fine. But when I try to run it says:
Exception in thread "main" java.lang.NoClassDefFoundError: MailExample
the command that i gave was :
prompt>java MailExample mail.host pbvs@hotmail.com pbvs@hotmail.com
Please let me know if sthing's wrong.
Aaron Briel

Joined: Aug 02, 2001
Posts: 6
I ran into the same problem when I tried to run a similar program. I checked the headers of my own emails (using outlook express with windows98), and found the server to be "smtp.email.msn.com". This should be the same for you if you (the client) are using msn.com for hosting...
Aaron Briel
I agree. Here's the link: http://aspose.com/file-tools
subject: smtp server error in javamail
It's not a secret anymore!