Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

If transport.send(msg) does not throw exception, what is guaranteed?

843830Sep 17 2004 — edited Sep 17 2004
Hello,

I have a section of code that sends an email using the transport.send(msg) method, in a try/catch block, catching SendFailedExceptions nested in a try/catch block that catches MessagingExceptions.
try{
  try {
    transport.send(msg);

    // "other code"
  }
  catch (SendFailedException sfe) {
    // some error logging here
  }
}
catch {MessagingException me) {
  // some more error logging here
}
The "other code" is being executed, so transport.send(msg) must be successful.

The email should be sent, but the intended recipient does not receive it. The SMTP server log, which logs errors only, does not show any problems at that time.

My question is, what can I guarantee to happen at that point, in terms of interaction with the SMTP server?
Is no exception a guarantee that the SMTP server successfully received the message?

Thanks for your help,

Mark.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2004
Added on Sep 17 2004
2 comments
378 views