If you encounter the same problem, please vote for issue
http://code.google.com/p/googleappengine/issues/detail?id=965

On 8 déc, 12:16, mably <fm2...@mably.com> wrote:
> Hi Ikai,
>
> Effectively the code you provided seems to work but not exactly as I
> hoped.
>
> Before 1.2.8, I was able to send an html email with inline images
> using the previous code.
>
> Now the image is sent as an external attachment.
>
> It's really sad we can't send nice html messages with images anymore.
>
> Do you know if it will work again anytime soon ?
>
> Thanx again for your help.
>
> François
>
> On 8 déc, 02:54, "Ikai L (Google)" <ika...@google.com> wrote:
>
>
>
> > François,
>
> > Can you give this a try?
>
> > ByteArrayDataSource mimePartDataSource = new ByteArrayDataSource(imgData,
> > inboundMimeBodyPart.getContentType());
> > attachment.setDataHandler(new DataHandler(mimePartDataSource));
>
> > On Sat, Dec 5, 2009 at 1:47 AM, mably <fm2...@mably.com> wrote:
> > > This code doesn't work anymore for me :
>
> > >    public void test() throws Exception{
>
> > >        String from = "x...@gmail.com";
> > >        String to = "x...@gmail.com";
> > >        String subject = "Testing multipart email";
> > >        String htmlText = "<h1>Hello</h1><img src=\"cid:image\">";
> > >        byte[] imgData = this.obtainByteData(
> > >                        "/com/mably/cms/themes/standard/resources/images/
> > > enveloppe.gif");
>
> > >        Properties props = new Properties();
> > >        Session session = Session.getDefaultInstance(props, null);
>
> > >        Message msg = new MimeMessage(session);
> > >        msg.setFrom(new InternetAddress(from));
> > >        msg.addRecipient(Message.RecipientType.TO, new InternetAddress
> > > (to));
> > >        msg.setSubject(subject);
>
> > >        Multipart mp = new MimeMultipart("related");
>
> > >        MimeBodyPart htmlPart = new MimeBodyPart();
> > >        htmlPart.setContent(htmlText, "text/html");
> > >        mp.addBodyPart(htmlPart);
>
> > >        MimeBodyPart attachment = new MimeBodyPart();
> > >        attachment.setFileName("test.gif");
> > >        attachment.setContent(imgData, "image/gif");
> > >        attachment.setHeader("Content-ID","<image>");
> > >        mp.addBodyPart(attachment);
>
> > >        msg.setContent(mp);
>
> > >        Transport.send(msg);
> > >    }
>
> > > What needs to be changed ?
>
> > > Any help will be greatly appreciated.
>
> > > François
>
> > > --
>
> > > 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-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2B
> > >  unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine

--

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-j...@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