How do i keep the
java mail transport object alive or connected.
I have written this code in a simple class file in a web application : -
the full code being
here
and i have commented out the finally block
Now everytime i run this code it takes some time to connect with the mail server
and the line
System.out.println("" + transport.isConnected());
prints a false
How do i retain the object transport as it does gets null and into the block
if(transport == null) {
or the transport object remains connected...
Thanks
Pradyut