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;
Image problem with Outlook email
-
- Posts: 4
- Joined: Mon Aug 08, 2016 2:49 pm
Outlook images issue...
Hi Sergei,
I'm thinking I'll need to parse the HTML and:
1. save the images as attachments
2. change the HTML tags to reflect what Outlook requires
For (1.), how do I access the original file names, so I can copy them to a temp folder, then reference the temp folder filename in the attachment.
When I look at the HTML, it just has the filename, not the path name.
Thanks,
Martin
I'm thinking I'll need to parse the HTML and:
1. save the images as attachments
2. change the HTML tags to reflect what Outlook requires
For (1.), how do I access the original file names, so I can copy them to a temp folder, then reference the temp folder filename in the attachment.
When I look at the HTML, it just has the filename, not the path name.
Thanks,
Martin
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
As I can see, you use CleverComponents.
All this work is already implemented, see here: http://www.trichview.com/forums/viewtopic.php?p=30791
clRVSendMail.pas contains the function
SendHTMLEmail() takes content from RV, all other message properties from Msg, and send it using Smtp.
CopyHTMLEmailFromRVToMsg() fills the Msg content from RV.
All this work is already implemented, see here: http://www.trichview.com/forums/viewtopic.php?p=30791
clRVSendMail.pas contains the function
Code: Select all
procedure SendHTMLEmail(RV: TCustomRichView; Smtp: TclSmtp; Msg: TclMailMessage;
HTMLKind: THTMLKind = htmlAdvanced; Attachments: TStrings = nil);
procedure CopyHTMLEmailFromRVToMsg(RV: TCustomRichView; Msg: TclMailMessage;
HTMLKind: THTMLKind = htmlAdvanced; Attachments: TStrings = nil);
CopyHTMLEmailFromRVToMsg() fills the Msg content from RV.
-
- Posts: 4
- Joined: Mon Aug 08, 2016 2:49 pm
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: