I am trying to print a table inside an e-mail using plain text. I have the following code:
string body = string.Format("{0,-30}{1,-30}{2,-50}{3,-40}",
"Col1", "Col2", "Col2", “Col4”);
body += string.Format("{0,-30}{1,-30}{2,-50}{3,-40}",
value1, value2, value3, value4);
Microsoft.Office.Interop.Outlook.ApplicationClass myOutlookApplication = null;
myOutlookApplication = new Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook.MailItem myNewMail =
(Microsoft.Office.Interop.Outlook.MailItem)myOutlookApplication.CreateItem(
Microsoft.Office.Interop.Outlook.OlItemType.olMailItem );
myNewMail.To = recipient;
myNewMail.Subject = subject;
myNewMail.Body = body;
myNewMail.BodyFormat = OlBodyFormat.olFormatPlain;
myNewMail.Send();
The problem I have is that the text for the body does not line up. It also seems to wrap the text inside the mail. Can anyone tell me what I may be doing wrong here?