//have a for loop that cycles through each mail to be generated for (int i = 0; i < dataGridView1.Rows.Count; i++) { // Create the Outlook application by using inline initialization. Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application(); MailItem oMsg = (MailItem)oApp.CreateItem(OlItemType.olMailItem); oMsg.BodyFormat = OlBodyFormat.olFormatHTML; using (StreamReader reader = File.OpenText(@"C:\Users\william-k\AppData\Roaming\Microsoft\Signatures\Pretoria 1.htm")) { oMsg.HTMLBody = reader.ReadToEnd(); } oMsg.Subject = dataGridView1.Rows[i].Cells["Case Number"].Value.ToString() + ' ' + dataGridView1.Rows[i].Cells["Catchword"].Value.ToString() + " / Renewal Reminder"; oMsg.Body = oMsg.Body = "Dear Sirs " + Environment.NewLine + Environment.NewLine + "Our attached for your kind attention." + Environment.NewLine + Environment.NewLine + "Kind Regards" + Environment.NewLine + "me" + oMsg.HTMLBody;
Kind Regards <HTML xmlns:o="urn:schemas-microsoft-com:office:office"><HEAD><!-- Signature generated by Exclaimer Signature Manager on {Current Date} --></HEAD> <BODY> <P> <TABLE style="WIDTH: 100%" cellSpacing=1 cols=1 cellPadding=0 border=0> <TBODY> <TR> <TD><span style='font-family:Calibri; font-size:small; color: Black; font-weight: bold; '>William Kruger</span></TD></TR> <TR> <TD><span style='font-family:Calibri; font-size:x-small; font-weight: bold; '>System Specialist</span></TD></TR>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)