I have following the sample code, and it works somehow.  But not as I
expected: (dummy code are omitted.)

                        Multipart mp = new MimeMultipart();
                        MimeBodyPart attachment = new MimeBodyPart();
                        byte[] attachmentData = "<html><h1>hello world<h/1></
html>".getBytes();
                        ByteArrayDataSource src = new ByteArrayDataSource
                                        (attachmentData, "application/html");
                        attachment.setDataHandler(new DataHandler(src));
                        attachment.setFileName("news.html");
                        mp.addBodyPart(attachment);
                        message.setContent(mp);
                        Transport.send(message);


I have use the same code in my local console test code, it will send
out the file as a real "attachment".
But if I drop this code to GAE, then there will be no "attachment"
present, instead, the main content itself will be the HTML escaped
original data.


I guess the implementation on GAE are using some automatically escape
process to be secure.

But why the attachment itself is send as the main body?  How can I
send out a attachment?  Thanks!

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to