I have enabled Email-to-Case functionality and in Email-to-Case settings checked: Enable Email-to-Case Enable HTML Email Enable on-demand service And routing adress is also set up.

Salesforce creates a case on behalf of the received email and does this fine. The problem is when the email has an attachment, then the email doesn't show as I would like it to: Email-converted to case

Below is how an email shows in salesforce (inbound email message) when i click "click here to view HTML version" link:

HTML version of email

I want the pictures to be shown is that possible?

Im aware that they are showing below as attachments, but want them to be shown either in the normal view of the case or in the "HTML version" view.

Is it possible to link to the html version of the email from the case description? And of course show the pictures in the html version also?

I will try to solve the problem with standard functionality if possible. Thanks in advance :-)

  • Any luck with getting this working?
    – iDog
    Jul 24, 2016 at 17:24

1 Answer 1


Update: Summer15 now supports images in emails. However it only works currently in case feed and in the "click here to view HTML version" link on the email record.

Your issue isn't with the HTML of the email, it is the embedded images. It is a long known 'limitation' of salesforce.


If you need a hacky workaround, the image place holders in the email message body can be matched to image attachments based on an Id order.

Expanded explanation: (please don't do this)

The place holders come in two forms

  • cid:imageName.png@asdf
  • cid:asdf

If the placeholder is in the first form, then you can just match the attachment by name. If it is in the 2nd form, the place older position is the same as the order the image attachment was inserted

List<Attachment> attachments = [
        , Body
        , ContentType
        , Name 
    FROM Attachment
    WHERE ParentId = :email.Id
    and contentType like 'image/%'
    order by Id asc];

Map<String, Attachment> attachmentMap = new Map<String, Attachment>();
for (Attachment a : attachments){
    attachmentMap.put(a.Name, a);

//list all the content-ids (cids) in the email
List<String> cidList = ....
for (Integer i = 0; i < cidList.size() && i < attachments.size(); i++){
    String cid = cidList[i];
    if (cid is of first form){
        .... get attachment by name
        Attachment a = attachmentMap.get(imageName);
    } else {
        .... cid is of 2nd form
        Attachment a = attachments[i];

  • Too bad. Do you Care to elaborate a bit on the workaround? Id order? May 7, 2014 at 22:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .