Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Sending SMTP mail when SMTP server is unavailable

Thread view: 
matthewjbarr@gmail.com - 24 Jan 2006 15:12 GMT
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
Juha Laiho - 24 Jan 2006 16:21 GMT
matthewjbarr@gmail.com 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.
Signature

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)

matthewjbarr@gmail.com - 24 Jan 2006 16:26 GMT
Thanks Wolf.

Matt
Roedy Green - 24 Jan 2006 18:53 GMT
>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.