Pascal (Lazarus/Delphi)
Pascal (Lazarus/Delphi)
Create Email with Embedded Link
Creating an email with an embedded link (HTML hyperlink).Chilkat Pascal (Lazarus/Delphi) Downloads
program ChilkatDemo;
// Demonstrates using the Chilkat Pascal wrapper via the C bridge DLL.
// Builds as a console application under Lazarus (FPC) or Delphi.
{$IFDEF FPC}
{$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
SysUtils,
CkDllLoader,
Chilkat.Email;
// ---------------------------------------------------------------------------
procedure RunDemo;
var
email: TEmail;
html: string;
mime: string;
begin
email := TEmail.Create;
// To create an email with an embedded link, use HTML:
html := '<html><body><p>Click here for more information: <a href="http://www.chilkatsoft.com/">Chilkat Software</a></body></html>';
email.SetHtmlBody(html);
// Continue building the email by adding the subject, recipients, etc...
mime := email.GetMime();
WriteLn(mime);
email.Free;
end;
// ---------------------------------------------------------------------------
begin
try
RunDemo;
except
on E: Exception do
WriteLn('Unhandled exception: ', E.ClassName, ': ', E.Message);
end;
WriteLn;
{$IFDEF MSWINDOWS}
WriteLn('Press Enter to exit...');
ReadLn;
{$ENDIF}
end.