Results 1 to 1 of 1
Thread: Java Mail Multipart Problem
- 01-04-2010, 03:36 PM #1Member
- Join Date
- Dec 2009
- Rep Power
Java Mail Multipart Problem
I've been knocking my head against this problem for a while -- help would be appreciated.
I'm sending a multipart message with an attachment.
I create a MimeMessage, set the "from", set the "to".
I Create a MimeMultipart. I try setting the this to
I create a text only bodypart and add it to the Multipart.
I create an html bodypart and add it to the multipart.
I read in an image, give it a symbolic name and add it to the multipart.
I create a bodypart and add an attachment to it and add it to the multipart.
Here's what happens:
When I set the multipart subtype to mixed, it reads in the image correctly and attaches the file, but BOTH the html and the plain text message show up in Yahoo and Gmail (which both seem to be set to always allow html ) In Outlook where I have set it up to be plain text only, it behaves correctly (except that the html is attached, but that doesn't bother me.)
When I set the multipart subtype to related, the behavior is the same.
When I set the multipart subtype to alternative, it sends the html and the plain text versions correctly, but doesn't send the attachment.
Is there a way to do everything I want to do?? I think there must be a solution to this.
Thanks in advance for your help.
Last edited by lowell108; 01-04-2010 at 03:40 PM.
- By lunarstyle in forum AWT / SwingReplies: 9Last Post: 12-19-2009, 05:14 PM
- By sandeepsai39 in forum New To JavaReplies: 4Last Post: 11-25-2009, 06:37 AM
- By npoorni in forum Advanced JavaReplies: 1Last Post: 06-30-2009, 04:09 PM
- By sundarjothi in forum Advanced JavaReplies: 0Last Post: 06-02-2008, 11:34 AM
- By namarc in forum Advanced JavaReplies: 2Last Post: 05-05-2008, 06:01 AM