I have a problem with the AppendFormat method of the StringBuilder class. I create a table and add data to the string builders object to send it as mail, but when I saw the mail I sent, it does not look like a table, its title and corresponding contents are not marked. I want the table to be separated by lines, as is usually the case with the Microsoft word table. how can I achieve this .. I am using the following code: Body is a StringBuilder object
if ( dic1 != null ) { //Body.AppendFormat("Client: " + cl + " Success. " + dic1.Count + " :"); Body.AppendFormat("<br/><table>"); Body.AppendFormat("<h1><tr><td>#</td><td>Files Name</td></tr></h1>"); int count = 1; foreach ((KeyValuePair<string, string> pair in dic1) { if (!String.IsNullOrEmpty(pair.Key)) { Body.AppendFormat("<tr><td>"+count.ToString()+"</td><td>" + pair.Key + "</td><td> " + pair.Value + "</td></tr>"); count++; //Body.Append( ); } } Body.AppendFormat("</table>");
After the output, I get in my inbox.
source share