[Demo] Send email using Microsoft Outlook COM object

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17684
Joined: Sat Aug 27, 2005 10:28 am
Contact:

[Demo] Send email using Microsoft Outlook COM object

Post by Sergey Tkachenko »

We already have demo projects showing how to create an independent email client for sending HTML emails created in TRichViewEdit: This demo is different: it sends emails using Microsoft Outlook, accessed as OLE/COM object.
Messages are composed in a TRichView editor, and are sent using Outlook.

To use this demo, Outlook object must be imported in Delphi.
To do it, open the menu "Component | Import Component", choose "Import a Type Library", select "Microsoft Outlook 16.0 Object Library", and install it into some package.

The demo is:
OutlookSendEmail.zip
(76.41 KiB) Downloaded 32 times
(UPDATED 2025-Feb-19)

It allows:
- sending email (to place it in Outbox)
- saving email (in Drafts)
- printing email using Outlook.
OutlookSendEmail.png
OutlookSendEmail.png (15.44 KiB) Viewed 175566 times
Images are embedded directly in email body.

This demo was created in Delphi 11 (but should work in Delphi XE7 and newer)
Sergey Tkachenko
Site Admin
Posts: 17684
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: [Demo] Send email using Microsoft Outlook COM object

Post by Sergey Tkachenko »

Update: this demo has been updated to use the HTML saving method that was introduced in version 21 (instead of the old, deprecated method).
Inline image saving is now a built-in feature of TRichView's HTML export, so the code for implementing it has been removed from the demo. Now, this feature is implemented by TRichView itself, and it works for all supported versions of Delphi, even for the old ones.
Note: inline images (embedded directly in <img src>) are supported not by all email clients. Microsoft Outlook does support them.
Post Reply