aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Java Mail 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 "Java Mail" Watch "Java Mail" New topic
Author

Java Mail

Arathi Raj
Ranch Hand

Joined: Nov 22, 2002
Posts: 90
Hi,
I downloaded Java mail API and JAF. I tried to run the program which is included in Java mail api called msgsend. I have used net beans to compile the program. It is compiling well. but when i execute the program it ask me to enter to address and subject. In javamail api they have mentioned to end the program by using ctrl-z. but that is not working and even it is not printing that your message has been sent. Can any one tell me how to do. The link is here regarding tutorial http://developer.java.sun.com/developer/onlineTraining/JavaMail/exercises/MailSetup/index.html
Megha Roy
Greenhorn

Joined: Sep 12, 2003
Posts: 13
Hi,
Somebody please help with this
Thanks
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Which mail server do you use? First of all, make sure your mail server is up and running, and then
1. Put mail.jar and activation.jar explicitly in your classpath
2. then compiled the program C:\javamail-1.3.1\demo\>javac msgsend.java
3. then tried running the program with
C:\javamail-1.3.1\demo>java msgsend -o from@domainName -M
NameOfYOurServer to@domainName
for example:
C:\javamail-1.3.1\demo>java msgsend -o John3001@yahoo.com -M
smtp.mail.yahoo.com Alice1024@yahoo.com
4. The console asks for the subject.
5. fill something in the Subject and followed by <enter>
6. write a message and followed by <enter>
7. ctrl Z to indicate end of message and followed by <enter>
8. "Mail was send successfully" should be prompted to the console
BTW, when testing with msgsend you can use msgshow afterwards to see if your message arrived, like this 'java msgshow -L pop3://userid assword@localhost'. (make sure that you compile msgshow.java first)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Mail