我有将 GridView 数据发送到 Outlook 的这段代码
Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem oMsg = (Microsoft.Office.Interop.Outlook.MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
string str;
MemoryStream ms = new MemoryStream();
try
{
gridView2.OptionsPrint.AutoWidth = false;
gridView2.OptionsPrint.UsePrintStyles = true;
gridView2.ExportToHtml(ms);
ms.Seek(0, SeekOrigin.Begin);
StreamReader sr = new StreamReader(ms);
str = sr.ReadToEnd();
}
finally
{
ms.Close();
}
oMsg.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
oMsg.Display(false);
oMsg.HTMLBody = OrderNumber + str +oMsg.HTMLBody;
我该怎么做,提前谢谢