html email with pics
Posted: Mon Nov 10, 2014 2:58 pm
Hi,
I am trying to send an html email with a picture in the body of the email and the picture is transformed in an attachment. Is this normal?
For this, I am using TRVReportHelper, TRvHtmlImporter, TRichView. Code is something like this:
lRVHelper:= TRVReportHelper.Create(nil);
lRVHtmlImporter := TRvHtmlImporter.Create(nil);
lRVHtmlImporter.RichView := lRVHelper.RichView;
...
SaveOptions := [rvsoOverrideImages];
FileName := Format('%sph_mail.html', [sMailDir]);
lRVHelper.RichView.SaveHTML(FileName, '', 'htmlimage', SaveOptions);
... and from here I grab the file and the eventual images and use Indy to send an email, something like this:
MB := TIdMessageBuilderHtml.Create;
TIdMessageBuilderHtml(MB).Html.Text := MailBody;
if imgs <> nil then
for i := 0 to imgs.Count - 1 do
TIdMessageBuilderHtml(MB).HtmlFiles.Add(imgs);
AddAttachments(MB);
My boss wants to get the picture in the body of the email, like it was when the message was created in TRichView. Is this possbile?
I am trying to send an html email with a picture in the body of the email and the picture is transformed in an attachment. Is this normal?
For this, I am using TRVReportHelper, TRvHtmlImporter, TRichView. Code is something like this:
lRVHelper:= TRVReportHelper.Create(nil);
lRVHtmlImporter := TRvHtmlImporter.Create(nil);
lRVHtmlImporter.RichView := lRVHelper.RichView;
...
SaveOptions := [rvsoOverrideImages];
FileName := Format('%sph_mail.html', [sMailDir]);
lRVHelper.RichView.SaveHTML(FileName, '', 'htmlimage', SaveOptions);
... and from here I grab the file and the eventual images and use Indy to send an email, something like this:
MB := TIdMessageBuilderHtml.Create;
TIdMessageBuilderHtml(MB).Html.Text := MailBody;
if imgs <> nil then
for i := 0 to imgs.Count - 1 do
TIdMessageBuilderHtml(MB).HtmlFiles.Add(imgs);
AddAttachments(MB);
My boss wants to get the picture in the body of the email, like it was when the message was created in TRichView. Is this possbile?