1

We are using a servicedesk application which is sending out e-mail using Exhange Web Service (EWS). But when sending e-mail with images (usually screenshots) the images is not showing. When right clicking an choosing view source in Outlook, we can se that the broken image har coding like this:

<img width=100 height=100 id="1" src="cid:&lt;helge.jpg&gt;">.

The image is broken also on webmail client like Gmail, Outlook.com.

The funny thing is that the image is displaying correctly when sending from the Servicedesk application to a user one the same Exchange server.

Our programmers have looked at the documentation for EWS:

https://msdn.microsoft.com/en-us/library/office/hh532564%28v=exchg.80%29.aspx?f=255&MSPPError=-2147217396

And the programmers of the ServiceDesk applcation have provived the code they use for EWS:

fileAttachment.ContentId = string.Concat("<", str, ">");

So based on the example from Microsoft, they add < and > around the id, but the example from Microsoft does not.

Our programmers made a explample using :

email.Attachments[0].ContentId = "WithoutAnglebrackets.jpg";
email.Attachments[1].ContentId = "<WithAnglebrackets.jpg>";

This resulted that the first attachment is showing in the Email, but not the other.

The servicedesk programmers is refering to https://www.rfc-editor.org/rfc/rfc2392, that the anglebrackets is allow.

They also is telling us that the application is working on their Exchange 2010. (We are using Exchange 2013).

So is this a Exchange problem? Or the the programmer wrong with adding anglebrackets?

Community
  • 1
  • 1

2 Answers2

0

The link your servicedesk programmers are referring does not even contain the word "exchange", so why exactly do they even use this document as a source?

Anglebrackets change the name of the file to a non-existing one, thus your broken images in the e-mails.

I wonder, what exactly the advantage of using angle brackets is. Better not use them for specifying file names.

NotTelling
  • 462
  • 3
  • 11
0

Problem is with the html you are using:

<img width=100 height=100 id="1" src="cid:&lt;helge.jpg&gt;">.

Here content id name should be without brackets, like:

<img width=100 height=100 id="1" src="cid:helge.jpg">.

Only in email attachment it should contain angle brackets in content id name. For example this is attachment part of email message we generate:

------=_Part_1_374681454.1595913735778
Content-Type: image/png; name=attachment.png
Content-Transfer-Encoding: base64
Content-ID: <attachment.png>
Content-Disposition: attachment; filename=attachment.png

iVBORw0KGgoAAAANSUhEUgAABoUAAAMACAYAAADi+m6JAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
...
Piro
  • 1,367
  • 2
  • 19
  • 40