HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions
{
HtmlFormatOptions = HtmlFormatOptions.WriteHeader | HtmlFormatOptions.WriteCompleteEmailAddress
};
if (File.Exists(htmlPath + fileName + ".html"))
{
int i = 1;
while (File.Exists(htmlPath + fileName + "(" + i.ToString() + ")" + ".html"))
{
i++;
}
mailMessage.Save(htmlPath + fileName + "(" + i.ToString() + ")" + ".html", htmlSaveOptions);
fileName = fileName + "(" + i.ToString() + ")";
}
else
{
mailMessage.Save(htmlPath + fileName + ".html", htmlSaveOptions);
}
I use this code to convert eml to html. But Some emails are not saved with enail headers.
How can i solve this issue??