Image problem with Outlook email
Posted: Mon Aug 08, 2016 5:30 pm
Hi,
I downloaded the trail version last year, but the project was put on hold.
It is now active again.
I am sending HTML emails via SMTP and Outlook.
SMTP works fine, but there is a problem with Outlook - images get replaced by a placeholder icon.
As soon as I get this working the client will order the product.
Many thanks,
Martin
My Delphi7 code is as follows:
try
oMailItem := Outlook.CreateMailItem;
if assigned( oMailItem ) then
with oMailItem do
begin
MsgTo := cemail;
Subject := 'TEST';
clSMTP1.UserName := '[email protected]';
clSMTP1.Password := '********';
clMailMessage1.From.FullAddress := mainfrm.mainform.MUserSMTPEmailFromAddressComp;
clMailMessage1.ToList.EmailAddresses := EdtTo.Text;
clMailMessage1.Subject := 'TEST ' + EdtSubject.Text;}
Options := [rvsoNoHypertextImageBorders, rvsoImageSizes,
rvsoUseCheckpointsNames];
Stream := TMemoryStream.Create;
RichViewEdit1.SaveHTMLToStream(Stream, '', '', '', Options);
Stream.Position := 0;
SetLength(s, Stream.Size);
Stream.ReadBuffer(PRVAnsiChar(s)^, Length(s));
HTMLBody := s;
try
Send;
MessageSent := True;
except
on e: Sysutils.Exception do
MessageDlg('Mail send failure', mtWarning, [mbOK], 0)
end;
end; // with oMailItem do
finally
// etc
end;
I downloaded the trail version last year, but the project was put on hold.
It is now active again.
I am sending HTML emails via SMTP and Outlook.
SMTP works fine, but there is a problem with Outlook - images get replaced by a placeholder icon.
As soon as I get this working the client will order the product.
Many thanks,
Martin
My Delphi7 code is as follows:
try
oMailItem := Outlook.CreateMailItem;
if assigned( oMailItem ) then
with oMailItem do
begin
MsgTo := cemail;
Subject := 'TEST';
clSMTP1.UserName := '[email protected]';
clSMTP1.Password := '********';
clMailMessage1.From.FullAddress := mainfrm.mainform.MUserSMTPEmailFromAddressComp;
clMailMessage1.ToList.EmailAddresses := EdtTo.Text;
clMailMessage1.Subject := 'TEST ' + EdtSubject.Text;}
Options := [rvsoNoHypertextImageBorders, rvsoImageSizes,
rvsoUseCheckpointsNames];
Stream := TMemoryStream.Create;
RichViewEdit1.SaveHTMLToStream(Stream, '', '', '', Options);
Stream.Position := 0;
SetLength(s, Stream.Size);
Stream.ReadBuffer(PRVAnsiChar(s)^, Length(s));
HTMLBody := s;
try
Send;
MessageSent := True;
except
on e: Sysutils.Exception do
MessageDlg('Mail send failure', mtWarning, [mbOK], 0)
end;
end; // with oMailItem do
finally
// etc
end;