2 Replies Latest reply: Jan 30, 2004 11:19 PM by 807582 RSS

    serializing MimeMessage

    807582
      Hi ,

      I would like to send the MimeMessage object via socket connection. To do do that i have written the following code fragment

      Socket s = new Socket("localhost",3200);
      OutputStream os = s.getOutputStream();
      MimeMessage mimemessage
      //
      //some code to create MimeMessage
      //
      mimemessage.writeTo(os);

      os.close() // this is important step

      In this code fragment if i didnt close the output stream the message is not being delivered to the server side. But when i close the output stream it is closing the socket connection with the stream connection.

      What i neeed is i will be sending mimemessage objects via socke asynchronously. For that purpose i would like to keep the outputstream of the socket keep opent always. But how can i send the mimemessage object via socket without closing the stream.

      Please help me.

      thanks in advance,

      Sridhar reddy .R