IMG tags are sometimes removed from HTML when reading mails from Exchange EWS

Hi Aspose,

We are using Apose Email EWS to read mails from Exchange and we are having a problem with some files where inline IMG tags are removed.

The attached ZIP file contains a MSG file where the three IMG tags are removed from the HTML. The image file is kept as a linked resource.

We are reading mails from Exchange using ListMessages and FetchMessage.

We are using the latest version of Aspose.Email.dll

With regards
Lars Bøndergaard
Nexcom A/S
lars@nexcom.dk

Hi Lars,


Thank you for writing to Aspose support team.

Could you please confirm to us if the sample MSG file you provided is the original file as I can’t see any images in this MSG? If not so, please provide us with the original sample MSG file that we can append to our Exchange Mailbox and then fetch it for investigating the issue further. We’ll look into it as soon as possible and assist you further accordingly.

Hi again,

The ZIP file that I send to you as part of creating the post contains following four IMG tags:

[image]

The images are seen as single dots three times in the mail. Scroll down to the bottom of the mail to find the dots.

I know the dot itself is not as major issue, but the inline attachment is shown still there, while the dots (IMG tags) are removed by Aspose.

/Lars

Hi Lars,

I have investigated the issue by appending this sample message (having 4 img src tags) )to my test exchange account and then downloaded it using Aspose.Email. It is observed that in the downloaded message there are 3 tags in the HTML body and one img src tag is dropped. This downloaded message is opened in Outlook and observed that there are three dots at the bottom of mail body.

I will log this issue of dropped tag but just need the clarification about your following comment:

nexcom.as:
I know the dot itself is not as major issue, but the inline attachment is shown still there, while the dots (IMG tags) are removed by Aspose.

Could you please describe the inline attachment issue along with some snapshot so that the issue could be logged?

Hi,

The attached ZIP file contains the original mail, the mail after being processed by Aspose (000080487.0001.msg) and a Word document showing the attachment file.

/Lars

Hi Lars,


Thank you for providing sample file.

I have uploaded the sample file (FW SV VS Fejl i eTips Globaletekster. IM251566. Prio 3 sid39812.msg) to my exchange test account and then downloaded it using Aspose.email. I am afraid that my result is different than the processed file (000080487.0001.msg) provided by you. In the downloaded file there is no attachment and DOTS are similar to the original uploaded file. Could you please give a try to the following sample code and share the feedback?


string dir = @“IMG+tags+are+sometimes+removed+from+HTML+when+reading+mails+from+Exchange+EWS”;
MailMessage msg = MailMessage.Load(dir + “FW SV VS Fejl i eTips Globaletekster. IM251566. Prio 3 sid39812.msg”);
// Create instance of IEWSClient class by giving credentials
IEWSClient client = GetAsposeEWSClient1();
ExchangeMailboxInfo mailbox = client.GetMailboxInfo();
// List all messages from Inbox folder
Console.WriteLine(“Listing all messages from Inbox…”);
//Declare variable for getting specified custom folder uri
ExchangeFolderInfo subfolderInfo = new ExchangeFolderInfo();
//Check if specified custom folder exists
client.FolderExists(mailbox.InboxUri, “592764”, out subfolderInfo);
if (subfolderInfo != null)
{
//MailMessage m = MailMessage.Load(“Enron Center Garage.msg”);
client.AppendMessage(subfolderInfo.Uri, msg);
msg.Dispose();
Thread.Sleep(10000);
ExchangeMessageInfoCollection coll = client.ListMessages(subfolderInfo.Uri);
foreach (ExchangeMessageInfo msgInfo in coll)
{
msg = client.FetchMessage(msgInfo.UniqueUri);
msg.Save(@“downloaded.msg”, Aspose.Email.Mail.SaveOptions.DefaultMsgUnicode);
Console.WriteLine(msg.Subject);
}
}

If it does not solve the issue, please send us the detailed steps to re-produce this scenario.