Hi ,

I have a java string like:
From: someuser.ha@domain.comDate: 8/7/2012 5:20:39 PMTo: abcd@domain.comCc: abcd.efg@domain.comSubject: This is the suject line Hi,I would like to recover all my money from the bank. Would you be able to send me them?Regards,Farooq.

Actually above is the email content which is read as a string in a java class.
Now I would like to email from java application.I'm using the below code.

MimeBodyPart htmlPart = new MimeBodyPart();
htmlPart.setContent(testcontent, "text/html");
MimeMultipart mimeMultipart = new MimeMultipart();
mimeMultipart.addBodyPart(htmlPart);
message.setContent(mimeMultipart);

I want help in breaking the above string in to a proper format.The to and CC can contain n number of addressess.
WILL BE VERY HELPFUL IF YOU COULD WRITE THE CODE, THANKS IN ADVANCE
Please Help urgently..

Define where you want to separate the input string into the desired subparts.
Look at the String class's methods for ways to find the boundary between one part and another and for methods to extract the desired substrings into separate Strings.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.