Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Sending SMTP mail when SMTP server is unavailable

Reply
Thread Tools

Sending SMTP mail when SMTP server is unavailable

 
 
matthewjbarr@gmail.com
Guest
Posts: n/a
 
      01-24-2006
Hi,

We're using the Java mail API to send simple emails from our system via
the company's Exchange server, which works just fine. However, we'd
like to know what happens if the SMTP server is down, and whether there
is a technique available to queue the sent messages in the event of the
SMTP service being unavailable, so that they may be resent at a later
date.

Any ideas?

Thanks,

Matt

 
Reply With Quote
 
 
 
 
Juha Laiho
Guest
Posts: n/a
 
      01-24-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) said:
>We're using the Java mail API to send simple emails from our system via
>the company's Exchange server, which works just fine. However, we'd
>like to know what happens if the SMTP server is down, and whether there
>is a technique available to queue the sent messages in the event of the
>SMTP service being unavailable, so that they may be resent at a later
>date.


If it's your application that is directly using the Java Mail API,
then you are apparently calling an implementation of
javax.mail.Transport.send() . This is documented to throw
javax.mail.SendFailedException if sending the message does not
succeed for some reason. So, to recover from this, you catch this
exception, and write logic in your application to handle queuing the
message.

So, the Java Mail API does not provide any queuing mechanism; if
you need one, you'll need to implement it.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
 
 
 
 
matthewjbarr@gmail.com
Guest
Posts: n/a
 
      01-24-2006
Thanks Wolf.

Matt

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-24-2006
On 24 Jan 2006 07:12:46 -0800, (E-Mail Removed) wrote, quoted or
indirectly quoted someone who said :

>We're using the Java mail API to send simple emails from our system via
>the company's Exchange server, which works just fine. However, we'd
>like to know what happens if the SMTP server is down, and whether there
>is a technique available to queue the sent messages in the event of the
>SMTP service being unavailable, so that they may be resent at a later
>date.


the easiest way to handle it would be to run your own local
mailserver. That's what they are for, queuing mail to send and
receive.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
sending of mail (smtp) - connection refused - but smtp server isrunning! Alex Hunsley Python 4 06-29-2004 04:30 PM
RE: sending of mail (smtp) - connection refused - but smtp serveris running! Raaijmakers, Vincent \(GE Infrastructure\) Python 0 06-29-2004 02:38 PM
Re: Error in sending attachement with Smtp.Mail Scott Allen ASP .Net 2 02-17-2004 04:36 AM



Advertisments