tags:

views:

21

answers:

1

Whenever I try to know the content type of multipart message by using javamail API, I'm getting the content type as:

 multipart/mixed; 
        boundary="----=_Part_19_32879825.1271840022140"

I've already disable my antivirus, but I'm still not able to terminate that boundary.

I'm trying to send the message using IMAP protocol.

I'm using Hmail Server.

Could anyone please tell me the reason of it?

+1  A: 

If the email that you're sending contains an attachment, this is not an error. It is how the message header is really supposed to be:

MIME-Version: 1.0

Content-Type: multipart/mixed; boundary="frontier"

This is a message with multiple parts in MIME format.

--frontier

Content-Type: text/plain

This is the body of the message.

--frontier

Content-Type: application/octet-stream

Content-Transfer-Encoding: base64

PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==

--frontier--

From: http://en.wikipedia.org/wiki/MIME

The value of the boundary attribute indicates where each message part finishes and the next one begins.

EDIT:

If you're getting an error related to missing end boundary (is that your question?), then you may want to set the missing end boundary to false:

The mail.mime.multipart.ignoremissingendboundary property may be set to false to cause a MessagingException to be thrown if the multipart data does not end with the required end boundary line. If this property is set to true or not set, missing end boundaries are not considered an error and the final body part ends at the end of the data

That's from the JavaMail API.

Bruno Rothgiesser