My problem is that i want to change the src value of some in the html of an email am getting. All this is already done, i used EWS api to establish connection and am using html agility pack to do the parsing. Anyone knows how to get the html with the changes i made to the src values in the images?
public static string parsearHtml(string body,Item item, ArrayList contentIDS, ArrayList urls)
{
string SRC = "";
int indice = 0;
string retorno = "";
//Console.WriteLine(body);
HtmlDocument email = new HtmlDocument();
email.LoadHtml(body);
foreach (HtmlNode img in email.DocumentNode.SelectNodes("//img"))
{
SRC = img.GetAttributeValue("src", null);
for (int i = 0; i < contentIDS.Count; i++)
{
if (SRC.Equals(contentIDS[i].ToString()))
{
indice = i;
break;
}
}
img.SetAttributeValue("src", urls[indice].ToString());
Console.WriteLine(img.GetAttributeValue("src", null));//in here i get the the attribute and its change so the changing of src values is working
//i tried email.save(retorno) but got error for empty path
//so i tried email.save(body) but got error for illegar characters in path
}
return retorno;
}