I need to be able to pass HTML data into Outlook like this:
MailMessage message = new MailMessage();
message.Body = myBody;
Initially, I thought I could pass plain text to it and use PadLeft like this:
somestring.PadLeft(100);
but it did not align everything properly because even though ||||| and MMMMM are both only 5 characters in length, they physically on the screen take up more space.
My solution is to convert data that is in my datatable into an HTML table and then pass it into Outlook.
- how do I convert a datatable into an html table?
- is there a better solution to my issue?
Loop over your DataTable, and build up the html string. IE: