This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Mail

 
Arathi Raj
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Somebody please help with this
Thanks
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic