Robert,

perhaps you may look at:
http://jakarta.apache.org/commons/sandbox/email/

there is allready an implemented multipartemail.clazz

i used them successfully in my application. they are
easy to use, you are *free* from the java-mail-api

Cheers,
matthias

> -----Original Message-----
> From: Robert Taylor [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 28, 2004 11:21 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] Sending multipart alternative emails (HTML and text)
> 
> 
> I've been tasked with sending out emails which contain both 
> HTML and text. I have successfully implemented this and 
> tested it in Outlook 2000, 2002, 2003, 
> Outlook Express and various web email clients (Yahoo, 
> Hotmail, etc...).
> 
> The problem I have is that some users, get the emails 
> with a message like the following:
> 
> "This message uses a character set that is not supported by 
> the Internet Service.  To view the original message content,  
> open the attached message. If the text doesn't display 
> correctly, save the attachment to disk, and then open it 
> using a viewer that can display the original character set."
> 
> Googling produced the following semi-helpful result:
> 
http://www.jguru.com/faq/view.jsp?EID=132654


Now, when I create the email message using the JavaMail API, I use
something similar to the following:

String text = // get text portion of email body
String html = // get html portion of email body

/*
* Create a multipart mime message where
* the client setting will determine which
* message is rendered.
*/
                                        
MimeMultipart multipart = new MimeMultipart("alternative");

// add text body part
MimeBodyPart textBodyPart = new MimeBodyPart();
textBodyPart.setText(text, "US-ASCII"); //char-set for encoding
        
// add HTML body part
MimeBodyPart htmlBodyPart = new MimeBodyPart();
htmlBodyPart.setContent(html, "text/html");
                        
multipart.addBodyPart(text);
multipart.addBodyPart(html);
        
msg.setContent(multipart);


Has anyone run into a simliar issue? It seems to only happen with
Outlook 2003 users, but since I cannot reproduce the problem, it's hard
for me to solve it.


robert



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to