Thanks SA for guiding me in the right direction
I eventually managed to solve it. My main issue was that I was using the Microsoft.Exchange.WebServices.Data class
I just want to put up the correct code in case anyone else with similar issue ends up here:
Refer -->
https://msdn.microsoft.com/en-us/library/office/hh532564(v=exchg.80).aspx
Ensure ur image name in ur string is same as the one u are setting it to.
My problem was my image name was - src="cid:image001.png@01D0624F.B3A11080"
and I was setting it to just image001.png.
once I cleaned up my string it displayed without issues
if(Attachments != null )
{
for (int i = 0; i <= Attachments.Count - 1; i++ )
{
_message.Attachments.AddFileAttachment(Attachments[i].FileName, Attachments[i].FileData);
if (Attachments[i].FileName.Contains(".png") || Attachments[i].FileName.Contains(".jpg") || Attachments[i].FileName.Contains(".jpeg"))
{
_message.Attachments[i].IsInline = true;
_message.Attachments[i].ContentId = Attachments[i].FileName;
}
}
}
Attachment is a List<mailattachment> where MailAttachment is a class with properties
<pre lang="cs">private string m_FileName = string.Empty;
private byte[] m_FileData = null;
We populate these from the DB where the file data is saved
Hope this will help someone out there
Thanks again to all who guided me