I have downloaded the file Aspose.Email_5.5.0.msi file. and installed it. I have added the references for the namespaces Aspose.Email.Mail and Aspose.Email.Outlook.
Requirement:
Need one button on web page, if we click on it .msg file has to be saved at particular location along with attachment.
Code:
using (var mailMsg = new MailMessage())
{
mailMsg.To = new MailAddress("abc@xyz.com");
mailMsg.Subject = “Hellow”;
mailMsg.IsBodyHtml = true;
mailMsg.Body = "body{font-size: 13px;font-family: Segoe
UI,Tahoma,Arial,Verdana,sans-serif;line-height:18px;color:
#1F497D;}b{font-size: 12px;}
UI,Tahoma,Arial,Verdana,sans-serif;line-height:18px;color:
#1F497D;}b{font-size: 12px;}
Hi,Please find the attached file (Format: .msg).
This request was generated via Oak Avenue Sample Application.
" mailMsg.Attachments.Add(new Attachment(Server.MapPath("~/TDDPartIII.pdf") ));
var outlookMsg = MapiMessage.FromMailMessage(mailMsg);
const string strMsgFile = @"E:\sample.msg";
outlookMsg.Save(strMsgFile);
}
I am getting the .msg file with the same body.
Please help me to resolve this issue.
Thanks in Advance.
(Attached is the result image)