Send email with HTML body of a report including images
How can we send an email including a HTML export of the report in the body of the email? The report contains a logo (image) that should be show up in the body of the email.
We use the following code:
This code results in a HTML body without the image.
We tried also with MHT export. That seems to inlcude the image but in the body it shows a complete syntax of a emai message.
How to solve this problem?
Tia
Hans
We use the following code:
MemoryStream htmlBody = new MemoryStream();
FastReport.Export.Html.HTMLExport htmlExportEmail = new FastReport.Export.Html.HTMLExport();
pdfFile = Path.GetTempPath() + @"\" + dtReport.Rows[0]["Subject"].ToString() + ".Html";
report1.Export(htmlExportEmail, htmlBody);
mail.IsBodyHtml = true;
htmlBody.Seek(0, SeekOrigin.Begin);
StreamReader readerHTML = new StreamReader(htmlBody);
string textHTML = readerHTML.ReadToEnd();
mail.Body = textHTML;
This code results in a HTML body without the image.
We tried also with MHT export. That seems to inlcude the image but in the body it shows a complete syntax of a emai message.
How to solve this problem?
Tia
Hans