====== Outlook: Ultimate insert images into signature that you can safely send ======
Outlook has a tendency to either not send embedded images with signatures, or it sends links to images (like in OWA)
The solution is to convert the image to Base64 string, and use it like that
Now, You can either use an online converter such as [[https://www.base64-image.de/|this one]], or you can start coding yourself:
// convert from bitmap to byte array
public byte[] getBytesFromBitmap(Bitmap bitmap) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(CompressFormat.JPEG, 70, stream);
return stream.toByteArray();
}
// get the base 64 string
String imgString = Base64.encodeToString(getBytesFromBitmap(someImg), Base64.NO_WRAP);
The imgString value is what you want to send
Other examples:
div.image {
width:100px;
height:100px;
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...);
}
An Image
http://www.your.domain
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...