The program represents a Delphi tutorial that utilizes the Clever Mail Message and S/MIME Message components to parse / compose E-mail messages in MIME format, with file or image attachments.
When using the TclMailMessage
component together with the POP3 or IMAP4 clients, the message parts are extracted and saved to the MailMessage members. If you save the message source with the TclMailMessage.SaveMessage method or access the message source via the TclMailMessage.MessageSource property, the message is recomposed. Since the attachmets are not stored in memory, the component raises the OnLoadAttachment event in order to get a stream with the attachment content. As a result, you will not get the original message content. If you want to get the origital source of the received message, please use the TclPop3.Response (TclImap4.Response) property instead. Otherwise, you will have to implement both the TclMailMessage.OnSaveAttachment and TclMailMessage.OnLoadAttachment event handers. This is necessary to save emails with attachments, and the given program shows you how to do this.
The other component, TclSMimeMessage
, represents the TclMailMessage descendant and provides an additional functionality to encrypt/decrypt and sign/verify the message using the S/MIME standard.
The given program utilizes both these components and additionally allows saving digitally verified message source. Comments within the source code will help you to understand how the code works.
Using this tutorial as a starting point, you can implement your own storage for the attached files and images, including database tables and in-memory streams.
How to compile:
Please feel free to Contact Us
and ask any program related questions.