File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes java mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "java mail" Watch "java mail" New topic

java mail

ven kumar

Joined: May 27, 2003
Posts: 3
I need to send an email from ejb. At the same time, I want to submit to mail queue, in case if my mail server is down!! That queue should look for my mail server availability and should send out emails. How do i do that?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

The JavaMail API is designed to use liteners to check connection events. So you can test whether or not a message made it to the SMTP server easily enough (read the docs to see exaclty how).

I'm not strictly sure what you mean by "mail queue", but its easy enough to persist unsent messages somewhere to be handled by another process. Just write them to a DB table or the file system or whatever, and write some occasional process to read any and try to resend.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: java mail
It's not a secret anymore!