I'm using EWS to send an email with inline attachement(s).
I'm use following code for it:
var attachment = attachments.AddFileAttachment(path);
attachment.ContentId = cid;
attachment.IsInline = true;
attachment.ContentType = "PNG/Image";
Html body of the message contains following fragment
<img src=""cid:{cid}""></img>
where {cid} is a value of cid field.
It works when I check emails with Outlook but in OWA image is not show in message body.
Please suggest me right way to send mail with inline image via EWS to view in OWA.
The below code works for me and I can see the inline attachment in Outlook/OWA/Mobile.
Steps:
HTML body with placeholders for contentids
Replace that placeholders with the actual attachment contentids
Create a new attachment and set the properties inline (true) and contentid (actual contentid for the associated attachment)