File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes java mail..plz help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

java mail..plz help

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hi all,
im trying to send mail using the SendMailServlet which come up with the tomcat 4.0.. But the servlet is throwing the exception
ENCOUNTERED EXCEPTION: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
I have kept the jar files in the /lib directory..i think some changes are necessary in the server.xml file..
can any1 tell me the real problem ??
thanks
Raj


SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
sorry i forgot to add this in the above post..i have set the value of mail.smtp.host in server.xml file.. shld i make any other changes to make the SendMailServlet working ???
Thankx
Raj
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
me again,
i solved it...congrats to me..LOL..but one more prob, right now the email address of the sender is displayed on the From field of mail box of the receiver.. is it possible to set it to some name.. am i making confusion.. In short, I just want to change the display name..is it possible thru java mail api ?? how ???
thanx in advance
Raj
SCJP2
darren schild
Ranch Hand

Joined: May 31, 2002
Posts: 32
Raj,
How did you solve your problem? I doubt mine is similiar but I am receiving a error upon instantiating the SendMailServlet class...
java.lang.NoClassDefFoundError: javax/mail/MessagingException
Any ideas?
lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
Hi

I come across the same problem,someone know how to solve it?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

darren:

ensure that mail.jar and activation.jar are in CATALINA_HOME/common/lib
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Raj:

Message.setFrom() accepts an Address. JavaMail accepts any properly formatted email address. The address spec (in case anyone wanted to know) is RFC 822.

That means, you can send in "john smith <john.smith@foo.com>" and if your email client is configured to do so, it will display only "John Smith". There's no particular way to "force" a client to show parts or the whole email address though.

http://www.freesoft.org/CIE/RFC/822/55.htm
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Okaaaay.

And I've just read the dates on those other posts.

Iyo, we'll continue this in your other thread
 
 
subject: java mail..plz help
 
Threads others viewed
Problem with java mail
Sending mail with two "@" in address
java mail
java mail
Problem with Java Mail
IntelliJ Java IDE