Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

javaMail question ( the same as previous topic with source code)

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I use javaMail for my javabean to send email in my web server. However I got the following error message when I compile it.:

my javabean Email.java has the source code as followed:


My application FinishRegister.jsp have the followed source code:


Thank you in advanced!
Yurong Chen
[ June 22, 2006: Message edited by: Ulf Dittmer ]
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you need to add the path of com.sun.mail.util.BEncoderStream to your server's classpath.
-Stu
 
Yurong Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is the problem! Thank you ! I ignored that package when I imported the javax.*.
However, I met a new problem now. I sent out the message without any error now. But I didn't receive the email in the destination email address. I wrote a test program for that and got the following message:

Could you help me to explain that?
Thanks in advance!
Yurong
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yurong.. this is not an answer to your problem... i don't know... .. but after looking at your code, have you tried using JSTL to send email?, it is BEAUTIFUL... I think it is called mailer taglib. I've used and it's great!
cheers
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Include com.sun.mail.handler package in ur class path.
 
Yurong Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Andres and Ankur,

I think my problem is on setting the environment variables. However, I have set the package into my classpath. It still gave me the error message when I compiled the program:

Should I put the source code of my program here? It is a little long.


Thank you for your kind help!

Yurong
[ June 22, 2006: Message edited by: Ulf Dittmer ]
 
Yurong Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Andres,
I want to try the JSTL to send email after my program running. It should be brilliant. I need time to learn that.
Yurong
 
Yurong Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
Thank you very much! I have solved the problem in Windows. However, I am still trying to set the right path in my web server.
Yurong
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I encounter a similar problem when i send a e-mail form my SMTP code.I am suing mail.jar(version 1.3.2) and activation.jar(version 1.0.2)- doenloaded from sun's site.And i have included it in the class-path.

This is the stackTrace i get when i set session.setDebug(true).
Pls. do let me know how you resolved it.



Regards,
priya

[ UD: added CODE tags ]
[ June 22, 2006: Message edited by: Ulf Dittmer ]
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Yurong,

could you let us know how you solved the problem? I also got the same problem.


Thanks
Benson
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just having mail.jar and activation.jar in your classpath is sufficient for compiling, but not for runtime. Depending on which protocols you use, you need some or all of smtp.jar, pop3.jar and imap.jar.
 
Sheriff
Posts: 26793
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
Just having mail.jar and activation.jar in your classpath is sufficient for compiling, but not for runtime. Depending on which protocols you use, you need some or all of smtp.jar, pop3.jar and imap.jar.

I don't believe this is correct. I have only mail.jar and activation.jar in my classpath at runtime and this works fine for SMTP and IMAP. I expect it would work for POP as well. My understanding is that smtp.jar and so on are extracts from mail.jar that you can use if having smaller jar files is important to you.
 
"To do good, you actually have to do something." -- Yvon Chouinard
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic