Hello, I am using the JavaMail API for the first time. I have written a program which uses the JavaMail API to write a message. This file compiles properly but when i run it thru the command line it gives me a NoClassDefFoundError. I have ensured tht the .class file is in the same directory from where i am trying to access it. I have stored the .class file under e:\Prog\javamail\demos and while using the command line i go to this path and give the command line. I am attaching the code herewith: Please let me know if there is any error in this code: import javax.mail.Session; import java.util.Properties; import javax.mail.*; import javax.mail.internet.*; public class MailMessage { public static void main(String args[]) { try { String host = args[0];
Properties props = new Properties(); props.put("mail.http.yahoo.com",host);
As a second note, simply calling e.getMessage() won't show anything. is what you (probably?) want. [This message has been edited by Mike Curwen (edited December 19, 2001).]
Jayashree Gopal
Greenhorn
Joined: Nov 06, 2001
Posts: 8
posted
0
Hello, The mail.jar has been added to the classpath and is present in the root directory of javamail. I tried to run the same program keeping it in the same directory as that of mail.jar .However,the problem still remains unsolved.