using Outlook = Microsoft.Office.Interop.Outlook; . . . string HTMLBody = ""; Outlook.Application oApp = new Outlook.Application() // Get the NameSpace and Logon information. Outlook.NameSpace oNS = oApp.GetNamespace("mapi"); // Log on by using a dialog box to choose the profile. oNS.Logon(Missing.Value, Missing.Value, true, true); // Create a new mail item. Outlook.MailItem mail = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); HTMLBody = File.ReadAllText("D:\\TLDR_VacationPlanner\\Email emplates\\VacationTemplate.html"); mail.To = strEmail; mail.HTMLBody = HTMLBody; mail.Send(); oNS.Logoff(); //oRecip = null; mail = null; oNS = null; oApp = null;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)