Sending SMTP mail when SMTP server is unavailable

Discussion in 'Java' started by matthewjbarr@gmail.com, Jan 24, 2006.

  1. Guest

    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
    , Jan 24, 2006
    #1
    1. Advertising

  2. Juha Laiho Guest

    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)
    Juha Laiho, Jan 24, 2006
    #2
    1. Advertising

  3. Guest

    Thanks Wolf.

    Matt
    , Jan 24, 2006
    #3
  4. Roedy Green Guest

    On 24 Jan 2006 07:12:46 -0800, 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.
    Roedy Green, Jan 24, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Allen
    Replies:
    2
    Views:
    2,218
    =?Utf-8?B?c2FtaWtkdXQ=?=
    Feb 17, 2004
  2. Alex Hunsley
    Replies:
    4
    Views:
    3,455
    Tim Williams (gmail)
    Jun 29, 2004
  3. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    877
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
  4. Replies:
    0
    Views:
    1,356
  5. Luke
    Replies:
    2
    Views:
    4,703
    Nigel Wade
    Mar 15, 2007
Loading...

Share This Page