How to extract Body and attachment from
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Indrajit_Guha
Posted On:   Friday, August 20, 2004 03:19 AM

I have developed an smtp server which can accept messages from outlook express.


The program takes in the message by calling the BufferedReader readline() method and sending appropiate responses through the PrintWriter println() method to a socket connection.


The whole message, including any attachments (if any) is being transmitted by Outlook Express and effectively received by my SMTP program.


How can I take out the attachment from the String data that I have received?

Re: How to extract Body and attachment from

Posted By:   Indrajit_Guha  
Posted On:   Sunday, August 22, 2004 11:08 AM

What I actually have done is -


while(!done)

{

if (incoming.isClosed()==true)

{

done=true;

}

else

{

String str=br.readLine();

if (str!=null)

{

if (str.equals("DATA"))

{

pw.println("354");

flag=false;

}

if (str.equals("QUIT")) done=true;

if (str.equals(".")) flag=true;

if (flag==true)

{

pw.println("250");

}

}

}

}


This code is sufficient for outlook express to send the
mail through and place an email in its sent items folder.



How do I store this string data so that I can create a
MIME-Message from which I will be able to extract the
body and any attachments if any.

About | Sitemap | Contact