MIME: Encrypt and sign message using S/MIME
Follow the instructions in the corresponding how-to article to setup the message.
If you need to sign the message, you need to provide certificates, used for signing. This is done by assigning a certificate storage to SignCertStorage property of TElSimpleSMIMEMessage class. At least one of certificates in the certificate storage must include the private key. This certificate must also be issued for e-mail signing and contain the e-mail address, which corresponds to the address in From: property of the mail message.
To encrypt the data using S/MIME, you need to provide certificates, used for encryption. This is done by assigning a certificate storage to EncryptCertStorage property of TElSimpleSMIMEMessage class. Use SMIMEOptions property of TElSimpleSMIMEMessage class to set the other encryption options. SMIMEOptions property references an instance of TElSimpleSMIMEOptions class.
Set EncryptMessage property of TElSimpleSMIMEOptions class to enable message encryption. You can set encryption algorithm using EncryptAlgorithm property of TElSimpleSMIMEOptions class. If the algorithm can operate with different key lengths (for example, AES can work with 128-bit, 192-bit and 256-bit keys), set EncryptBitsInKey property of TElSimpleSMIMEOptions class to desired key length.