? Send Attachment with Specified MIME Type
843830Nov 28 2001 — edited Nov 29 2001Hi, all,
I am developing email client app with JavaMail1.2, I want to send audio/mp3 file as an attachment with the specified MIME type, that is, audio/mp3, so when I receive a mail with an attachment whose MIME type is audio/mp3, I can invoke my Mp3Player in the email client app, but How can I specify the attachment's MIME type when I send it?
the code below doesn't work:
...
byte[] mp3data = getData(mp3File);
...
MimeBodyPart mp3bp = ...
mbp.setContent(mp3data, "audio/mp3");
MultiPart mp = ...
mp.addBodyPart(mp3bp);
...
It compiled, but when I run it, I got the following exceptions:
...
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type audio/mp3
...
Who can tell me what's wrong, or how can I do what I want? Thanx