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
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
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
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.
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.
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