How / when does one use a TransportListener?

John Zukowski

You can add a TransportListener to a specific instance of the Transport you are using. In other words, you have to get a specific Transport, like with Transport transport = session.getTransport("smtp") to get the Transport. You can't just use the send() method to send the message. Once you have a Transport, add a listener with addTransportListener(). It will then be notified of successful or unsuccessful sending of the message. A partially successful send is if some of the recipients are not valid, but at least one is valid.

Also, be sure not to use Transport.send().

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact