Hi,
I use aspose cell to create excel report and aspose email to send it.
we need to put a graph and tab in body of the email but the graph doesn’t work in some cases.
Codes:
string workingPath = @“D:\test\e-mail\working.mht”;
string NotworkingPath = @“D:\test\e-mail\notworking.mht”;
using (Workbook w = new Workbook(@“D:\test\e-mail\Example.xlsx”))
{
w.Worksheets.ActiveSheetIndex = w.Worksheets[“Working”].Index;
Aspose.Cells.HtmlSaveOptions mhtml = new Aspose.Cells.HtmlSaveOptions(Aspose.Cells.SaveFormat.MHtml);
mhtml.ExportActiveWorksheetOnly = true;
mhtml.ExportImagesAsBase64 = true;
w.Save(workingPath, mhtml);
w.Worksheets.ActiveSheetIndex = w.Worksheets[“Not Working”].Index;
w.Save(NotworkingPath, mhtml);
}
MhtmlLoadOptions opt = new MhtmlLoadOptions();
MsgSaveOptions sopt = new MsgSaveOptions(MailMessageSaveType.OutlookMessageFormat);
using (MailMessage workingMail = MailMessage.Load(workingPath, opt))
{
workingMail.IsDraft = true;
workingMail.Save(@“D:\test\e-mail\working.msg”, sopt);
}
using (MailMessage workingMail = MailMessage.Load(NotworkingPath, opt))
{
workingMail.IsDraft = true;
workingMail.Save(@“D:\test\e-mail\notworking.msg”, sopt);
}
Thanks for your help