Any SMTP server will queue the mail for you automatically.  That's built-in
to the protocol.

I'm not sure I understand what you're looking for...it sounds like you are
looking for a SMTP server written in Java. There are plenty of free, open
source SMTP mailers out there, but if you need it in Java, that would be the
JavaMail API: http://java.sun.com/products/javamail/, most likely
com.sun.mail.SMTPTransport.sendMessage(Message message, Address[]
addresses).

I don't think JavaMail offers any queueing or redundancy, but you can use a
simple database operation...insert a record just before the message is sent,
send the message, and trap any exceptions.  If no exceptions, mark the new
record as "sent".  Periodically, have a process look in the database for
records that have an exception, then attempt to resend them, assuming the
logged exception is "server down" and not "user unknown" or something else
that would prohibit the email from being sent.

John


> -----Original Message-----
> From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 22, 2002 12:58 PM
> To: [EMAIL PROTECTED]
> Subject: A little of topic - Global e-mail sending facility inside of
> tomcat?
> 
> 
> This is a little of topic, but I'm sure someone on this list has
> implemented something similar with tomcat.
> -->
> I have several applications running on Tomcat 4.1.12 that I 
> need to add
> the capability to send e-mail via a SMTP server. There are 
> two problems
> -
> 
> 1.) Are there any products or open source projects available that will
> que the mail in case the SMTP server is down and re-send it later,
> including the possibility of a tomcat re-start before the SMTP server
> comes back up? Basically I want a way to insure an automated e-mail is
> sent when a person registers, and is not "lost" when the e-mail server
> is down.
> 
> 2.) Is there a way to configure this service as a global JNDI resource
> available to all applications running inside of tomcat?
> 
> Thanks,
> Ryan
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to