Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate

Unreleased...
Bzip2
LZW
Icon

Type Conversion

 

Article: Understanding COM References in Delphi

Access Embedded HTML images and style sheets

Download Chilkat Email ActiveX

Demonstrates how to examine an HTML email's embedded objects (related items). Shows how to get the related item filename, content-ID, and data.

procedure TForm1.Button26Click(Sender: TObject);
var
  email: CHILKATMAILLib2_TLB.IChilkatEmail2;
  numRelatedItems: Integer;
  i: Integer;
  filename: String;
  contentId: String;
  relatedItemData: OleVariant;
begin
  ChilkatMailMan21.UnlockComponent('Anything for 30-day trial');
  ChilkatMailMan21.SmtpHost := 'smtp.comcast.net';

  // Load an HTML email...
  email := ChilkatMailMan21.NewEmail();
  email.LoadEml('htmlEmail.eml');

  // The embedded HTML images and/or style sheets are "related" items.
  numRelatedItems := email.NumRelatedItems;
  for i := 0 to numRelatedItems-1 do begin
    // The filename and content ID (cid) can be retrieved with these method calls:
    filename := email.GetRelatedFilename(i);
    contentId := email.GetRelatedContentID(i);

    // An individual related item can be saved to a file in a directory.
    // This call saves the related item to the 'relatedItems' subdirectory
    email.SaveRelatedItem(i,'relatedItems');

    // The binary data of a related item can be retrieved by calling GetRelatedData.
    // (You'll have to research how to use an OleVariant.  That is not explained
    // in this example.)
    relatedItemData := email.GetRelatedData(i);
  end;
end;

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser