Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mail servlet

 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create an emailing servlet. I've been getting this error running my mail.jsp that calls for my SendData servlet:
"java.lang.NoClassDefFoundError: javax/mail/Address"
when I do
mimeMessage.setFrom(internetAddrFrom);
but not when just
mimeMessage.setFrom();
Can anyone tell me how to get around this error or post a link for implementation example on how to build this sort of servlet? Thanks in advance.

P.S I'm using these these libraries:
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can only guess that java mail API libraries are not in your runtime class path. make sure that they are in web-inf/lib or in servlet container common libraries location. If you need a simple mail send I can give you very small class not requiring Java mail API.
 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Could you please post the class, or email it to me liliyaw@hotmail.com ? Liliya
 
Rashid Mayes
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a mail.jar? You need to make certain the jar files containging the mail classes are in your call path. You can add missing libraries to the WEB-INF/lib directory.
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by liliya woland:
Yes, Could you please post the class, or email it to me liliyaw@hotmail.com ? Liliya
done.
 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone. My libs were after all out of wack.
Dmitriy, thanks for the file, looks very promissing!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic