How to test JAVAXMAIL program

milan doshi

Ranch Hand

Posts: 43

posted 16 years ago

Hello, I am developing a site wherin I`m supposed to send/recieve Emails. I understand that I will have to use the javax.mail package. But is it that it cannot be tested on JavaWebServer or Apache Server? If so how do I use it? I mean how to check while under development? Thanx in Advance, Milan Doshi

Frank Carver

Sheriff

Posts: 6920

posted 16 years ago

If you do a search on this site for "JavaMail", you should find lots of discussion and examples.

Sure it's possible. Pleanty of people have written web-interfaced mail programs using servlets and JavaMail. You should also be able to run such servlets on any reasonable servlet container, which includes morern versions of JavaWebServer as well as Apache/JServ and Apache/Tomcat as well as a lot of others: Resin, JRun, ServletExec, Gefion .....

Hi, If you want to test whether your java mail enabled program works or not, then follow these steps. 1) Download the javamail api from www.javasoft.com/products/javamail website. 2) Download the java activation frame work from www.javasoft.com/products website. 3) edit ur autoexec.bat file and set classpath as follows: ---------------------------------------------------------------- set classpath=.;c:\javamail-1.1.3\mail.jar;c:\javamail-1.1.3\pop3.jar;c:\jaf-1.0.3\activation.jar; ---------------------------------------------------------------- Now compile the program and run the program. JavaMail api is a platform independent and you can run it on posix compliant or windows compliant. It can run on javawebserver and as well as also apache. What u have to do is set the classpath in ur autoexec.bat (if ur using windows platform) or .profile(if ur using unix platform) If you want some examples, go to javamail directory and in that you can find demo subdirectory and there u can find some very interesting examples. I hope this info may find useful to you. Bye. Loke. [This message has been edited by lokesh reddy (edited November 13, 2000).]

milan doshi

Ranch Hand

Posts: 43

posted 16 years ago

Thanks Frank and Lokesh. Lokesh your detailed explaination is really very helpful. I will immediately do as stated. Thanx once again, Milan

Anonymous

Ranch Hand

Posts: 18944

posted 16 years ago

Hello all, I tried to run the demo available in the javamail package configuring the JAVAWEBSERVER2.0 as per the guideline given in the README file .But I am confused as to what is to be used as IMAP host .Also, I didnot find jws.jar in the javawebserver2.0\LIB package which needs to be set in the class path. Can anyone help? Manish