why doesn`t setHeader("Content-Type","....") not work???
Hello,
i'am trying to create a mail-gateway with javamail and get this problem when i try to set the Content-Type of a message.
First i do this Code-lines:
MimeMessage newMessage = new MimeMessage(mailSession);
newMessage.setFrom(new InternetAddress(this.from));
newMessage.addRecipients(Message.RecipientType.TO,
this.recipients);
newMessage.setSubject(this.subject);
BodyPart messageBP = new MimeBodyPart();
messageBP.setContent(this.bodyText,"text/plain");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBP);
newMessage.setContent(multipart);
After that the Mail has the Content-Type "multipart/mixed"! That is OK. But after these lines i do following lines:
newMessage.setHeader("Content-Type","multipart/mixed; start=DICOMDIR; type=application/dicom");
newMessage.saveChanges();
i've to do this, because i need the parameter start and type for another application, which will receive this message. But after this line these parameter aren't saved. The content-Type is also "multipart/mixed". WHY??? Please help.
Is there another way for changing the header "content-type"?????
Thx,
Timo Bunger from Germany