commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [email] bad cid returned from embed in HtmlEmail?
Date Wed, 15 Oct 2003 22:25:01 GMT
I think its fair to say that [email] has no active developers at present.
And I'm afraid I don't know the code or mail API well enough to be able to
answer your question. Sorry.

Stephen

----- Original Message -----
From: "joel.mailinglists" <joel.mailinglists@gameoefter.org>
> i posted the following mail to this mailinglist some weeks ago
> (2003.09.25). nobody answered. i also tired to mail an author of the
> source code. no anwer.
> is the email project dead? i know that nobody has to answer an email.
> but i think it's good to know if a jakarta (sub) project is dead or not.
>
> greets.
> joel
>
> Joel Gautschi wrote:
> > hi,
> >
> > the embed(URL url, String name) method of
> > org.apache.commons.mail.HtmlEmail returns the cid for the embeded url.
> > the cid contains a random ascii string (containing chars like <,",',
etc.).
> > of course it didn't worked in the email client if I used a cid
> > containing char like <,",' that's why I tried to url encode (using
> > java.net.URLEncoder). but it doens't worked also (at least not in the
> > outlook and mozilla mail client).
> >
> > that's why I changed the line
> >
> > String cid = RandomStringUtils.randomAscii(10);
> >
> > to
> >
> > String cid = RandomStringUtils.randomAlphanumeric(10);
> >
> > now it works.
> >
> > but I wanted to ask if I understood sth wrong because I think there
> > would be more uses than me how ran into this problem. If other users ran
> > into the same problem we should fix the embed method. I don't know if my
> > randomAlphanumeric(10) is a good solution.
> >
> > joel
> > below: original embed method from org.apache.commons.mail.HtmlEmail.
> >
> > ---
> >     public String embed(URL url, String name) throws MessagingException
> >     {
> >         MimeBodyPart mbp = new MimeBodyPart();
> >
> >         mbp.setDataHandler (new DataHandler(new URLDataSource(url)));
> >         mbp.setFileName(name);
> >         mbp.setDisposition("inline");
> >         String cid = RandomStringUtils.randomAscii(10);
> >         mbp.addHeader("Content-ID", cid);
> >
> >         inlineImages.add(mbp);
> >         return mbp.getContentID();
> >     }
> > ---
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message