Hi, You can use the javamail api for this. You'll also need the JAF API. You can get the javamail API and java activation framework (JAF) API from the sun site. Check out the code below, you can adapt it to your needs:
Hi, 1. From account should be a valid account on the yahoo server. 2. Yahoo mail server requires authentication, so set the property "mail.smtp.auth" to true. 3. To get debugging info call setDebug(true) on session object. Hope this helps.
Hi, You can try the following: File fil = new File(filename); FileOutputStream fos=null; if (fil.exists()){ // file is already there so append to it fos = FileOutputStream(fil,true); } else{ fos=new FIleOutputStream(fil); }
hope this helps, Lester. [ March 12, 2002: Message edited by: Les Dsouza ]
If you are reading the user input from System.in then the problem maybe because System.in.read returns the user entered text+Carriage return + linefeed (in windows, in unix it will have text+ CR). Hence you need to discard these before using the input string for comparison. check out the example below:
If TextFileIn is a class defined by you make sure it can be found in one of the folders in your classpath. Also make sure your classpath includes "." (ie the current folder). If textFileIn is not in a package, put it in th3e same folder as your main class and then compile. If TextFileIn is in a package then you need to import it. You can also check out the following code: