Hi all,

I would like to send emails with some given html, sometimes my html contains 
base64 encoded images, I mean images like this 
https://jsfiddle.net/casiano/xadvz/

<img 
src="data:image/gif;base64,R0..................................................

I'm using commons email 1.4 and when I send that html, using 
email.setDataSourceResolver(new DataSourceUrlResolver(null));, I receive this:

Caused by: java.net.MalformedURLException: unknown protocol: data
        at java.net.URL.<init>(URL.java:600)
        at java.net.URL.<init>(URL.java:490)
        at java.net.URL.<init>(URL.java:439)
        at 
org.apache.commons.mail.resolver.DataSourceUrlResolver.createUrl(DataSourceUrlResolver.java:115)

I'm going to parse the html, finding those encoded img, decoding them to obtain 
file and embedding it as suggested int he guide 
https://commons.apache.org/proper/commons-email/userguide.html.

Nevertheless it seems strange that commons email is not able to handle with 
those inline images that are quite common in signatures, am I wrong?
Thanks and best regards

Raffaele Gambelli

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to