public static string getEmailFile(string file) { //string filename = Session["filename"].ToString(); Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application(); //MailItem item = (MailItem)app.CreateItemFromTemplate(@"C:\Users\orculloj\Desktop\Sample3\" + filename, Type.Missing); //MailItem item = (MailItem)app.CreateItemFromTemplate(@"C:\Users\orculloj\Desktop\Sample3\Test.msg", Type.Missing); MailItem item = (MailItem)app.CreateItemFromTemplate(@"C:\Users\orculloj\Desktop\Sample2\20160101021244_5541.msg", Type.Missing); var a = item.HTMLBody; return a; }
Outlook.Application app = new Outlook.Application(); MailItem item = (MailItem)app.CreateItemFromTemplate(@"C:\Users\orculloj\Desktop\Sample2\20160101021244_5541.msg", Type.Missing); string from = item.ReceivedOnBehalfOfName + "@altisource.com"; //string body = item.HTMLBody; iframe1.Attributes["src"] = "Email.aspx"; System.Net.Mail.MailMessage mailMsg = new System.Net.Mail.MailMessage(); MailAddress mailAddress = new MailAddress(from); mailMsg.To.Add("JohnEmmanuel.Orcullo@altisource.com"); mailMsg.From = mailAddress; // Subject and Body mailMsg.Subject = "Testing mail.."; string x = ""; mailMsg.IsBodyHtml = true; mailMsg.Body = getEmailFile(x); //SmtpMail.SmtpServer = "Internal-Mail.ascorp.com"; SmtpClient smtpClient = new SmtpClient("Internal-Mail.ascorp.com"); //smtpClient.EnableSsl = true; smtpClient.Send(mailMsg);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)