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
posted
0
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
posted
0
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
posted
0
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
posted
0
Hi
I come across the same problem,someone know how to solve it?
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.