---
product: Chilkat
product_version: 11.7.0
language: wc
language_label: Unicode C
class: Email
license: bundle
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/wc_CkEmailWRef.html
---
# Chilkat Email — Unicode C — v11.7.0

> Chilkat 11.7.0 · language=wc · class=Email
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Email.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/guide.md`.

## Purpose

**Create, inspect, modify, secure, load, and save complete email messages.**

`Chilkat.Email` represents a complete MIME email message, including headers, sender and recipient fields, subject, plain-text and HTML bodies, attachments, embedded HTML resources, attached messages, custom headers, and security-related information such as S/MIME signing and encryption status. It is the message object used throughout Chilkat when composing, parsing, modifying, saving, sending, receiving, or processing email.

**Compose messages**

Build email messages with sender, recipients, subject, text body, HTML body, reply-to fields, custom headers, and MIME structure.

**Attachments and embedded content**

Add, inspect, extract, remove, or save file attachments, embedded images, related HTML resources, and attached email messages.

**Load and save MIME**

Load email from MIME text, files, byte data, or strings, and save the message back to MIME, XML, files, or other supported forms.

**Inspect received email**

Read headers, addresses, dates, message IDs, body alternatives, attachments, encodings, and other fields from downloaded or parsed messages.

**S/MIME security**

Work with signed, encrypted, or signed-and-encrypted messages, including certificate-related information and security status.

**Works with mail transports**

Use `Email` objects with `MailMan`, `Imap`, `EmailBundle`, and related Chilkat classes for sending, receiving, downloading, and organizing mail.

**Common pattern:** Use `Chilkat.Email` to represent and manipulate the message itself. Use transport classes such as `MailMan` or `Imap` to send, receive, fetch, or manage messages on mail servers. After downloading or creating an email, use this class to inspect headers, modify content, handle attachments, save MIME, or prepare the message for further processing.

For an extended overview, see [Email Class Overview](https://www.chilkatsoft.com/email_class_overview.asp).

## Object creation, unlocking and error handling

**Create/Dispose**

```c
HCkEmailW instance = CkEmailW_Create();
// ...
CkEmailW_Dispose(instance);
```

`HCkEmailW CkEmailW_Create(void);`

Creates an instance of the HCkEmailW object and returns a handle ("void \*" pointer). The handle is passed in the 1st argument for the functions listed on this page.

`void CkEmailW_Dispose(HCkEmailW handle);`

Objects created by calling CkEmailW_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkEmailW_Dispose.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Unicode C.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `void CkEmailW_getDebugLogFilePath(HCkEmailW cHandle, HCkString retval); void CkEmailW_putDebugLogFilePath(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_debugLogFilePath(HCkEmailW cHandle);` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `void CkEmailW_getLastErrorHtml(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_lastErrorHtml(HCkEmailW cHandle);` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `void CkEmailW_getLastErrorText(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_lastErrorText(HCkEmailW cHandle);` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `void CkEmailW_getLastErrorXml(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_lastErrorXml(HCkEmailW cHandle);` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `BOOL CkEmailW_getLastMethodSuccess(HCkEmailW cHandle); void CkEmailW_putLastMethodSuccess(HCkEmailW cHandle, BOOL newVal);` | read/write | Indicates the success or failure of the most recent method call: `TRUE` means success, `FALSE` means failure. |
| `VerboseLogging` | `BOOL CkEmailW_getVerboseLogging(HCkEmailW cHandle); void CkEmailW_putVerboseLogging(HCkEmailW cHandle, BOOL newVal);` | read/write | If set to `TRUE`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `void CkEmailW_getVersion(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_version(HCkEmailW cHandle);` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `Body` | property, read/write | `void CkEmailW_getBody(HCkEmailW cHandle, HCkString retval); void CkEmailW_putBody(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_body(HCkEmailW cHandle);` |
| `Charset` | property, read/write | `void CkEmailW_getCharset(HCkEmailW cHandle, HCkString retval); void CkEmailW_putCharset(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_charset(HCkEmailW cHandle);` |
| `Decrypted` | property, read-only | `BOOL CkEmailW_getDecrypted(HCkEmailW cHandle);` |
| `EmailDateStr` | property, read/write | `void CkEmailW_getEmailDateStr(HCkEmailW cHandle, HCkString retval); void CkEmailW_putEmailDateStr(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_emailDateStr(HCkEmailW cHandle);` |
| `EncryptedBy` | property, read-only | `void CkEmailW_getEncryptedBy(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_encryptedBy(HCkEmailW cHandle);` |
| `FileDistList` | property, read/write | `void CkEmailW_getFileDistList(HCkEmailW cHandle, HCkString retval); void CkEmailW_putFileDistList(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_fileDistList(HCkEmailW cHandle);` |
| `From` | property, read/write | `void CkEmailW_getFrom(HCkEmailW cHandle, HCkString retval); void CkEmailW_putFrom(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_from(HCkEmailW cHandle);` |
| `FromAddress` | property, read/write | `void CkEmailW_getFromAddress(HCkEmailW cHandle, HCkString retval); void CkEmailW_putFromAddress(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_fromAddress(HCkEmailW cHandle);` |
| `FromName` | property, read/write | `void CkEmailW_getFromName(HCkEmailW cHandle, HCkString retval); void CkEmailW_putFromName(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_fromName(HCkEmailW cHandle);` |
| `Header` | property, read-only | `void CkEmailW_getHeader(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_header(HCkEmailW cHandle);` |
| `Language` | property, read-only | `void CkEmailW_getLanguage(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_language(HCkEmailW cHandle);` |
| `LocalDateStr` | property, read/write | `void CkEmailW_getLocalDateStr(HCkEmailW cHandle, HCkString retval); void CkEmailW_putLocalDateStr(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_localDateStr(HCkEmailW cHandle);` |
| `Mailer` | property, read/write | `void CkEmailW_getMailer(HCkEmailW cHandle, HCkString retval); void CkEmailW_putMailer(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_mailer(HCkEmailW cHandle);` |
| `NumAlternatives` | property, read-only | `int CkEmailW_getNumAlternatives(HCkEmailW cHandle);` |
| `NumAttachedMessages` | property, read-only | `int CkEmailW_getNumAttachedMessages(HCkEmailW cHandle);` |
| `NumAttachments` | property, read-only | `int CkEmailW_getNumAttachments(HCkEmailW cHandle);` |
| `NumBcc` | property, read-only | `int CkEmailW_getNumBcc(HCkEmailW cHandle);` |
| `NumCC` | property, read-only | `int CkEmailW_getNumCC(HCkEmailW cHandle);` |
| `NumDaysOld` | property, read-only | `int CkEmailW_getNumDaysOld(HCkEmailW cHandle);` |
| `NumDigests` | property, read-only | `int CkEmailW_getNumDigests(HCkEmailW cHandle);` |
| `NumHeaderFields` | property, read-only | `int CkEmailW_getNumHeaderFields(HCkEmailW cHandle);` |
| `NumRelatedItems` | property, read-only | `int CkEmailW_getNumRelatedItems(HCkEmailW cHandle);` |
| `NumReplacePatterns` | property, read-only | `int CkEmailW_getNumReplacePatterns(HCkEmailW cHandle);` |
| `NumReports` | property, read-only | `int CkEmailW_getNumReports(HCkEmailW cHandle);` |
| `NumTo` | property, read-only | `int CkEmailW_getNumTo(HCkEmailW cHandle);` |
| `OaepHash` | property, read/write | `void CkEmailW_getOaepHash(HCkEmailW cHandle, HCkString retval); void CkEmailW_putOaepHash(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_oaepHash(HCkEmailW cHandle);` |
| `OaepMgfHash` | property, read/write | `void CkEmailW_getOaepMgfHash(HCkEmailW cHandle, HCkString retval); void CkEmailW_putOaepMgfHash(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_oaepMgfHash(HCkEmailW cHandle);` |
| `OaepPadding` | property, read/write | `BOOL CkEmailW_getOaepPadding(HCkEmailW cHandle); void CkEmailW_putOaepPadding(HCkEmailW cHandle, BOOL newVal);` |
| `OverwriteExisting` | property, read/write | `BOOL CkEmailW_getOverwriteExisting(HCkEmailW cHandle); void CkEmailW_putOverwriteExisting(HCkEmailW cHandle, BOOL newVal);` |
| `Pkcs7CryptAlg` | property, read/write | `void CkEmailW_getPkcs7CryptAlg(HCkEmailW cHandle, HCkString retval); void CkEmailW_putPkcs7CryptAlg(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_pkcs7CryptAlg(HCkEmailW cHandle);` |
| `Pkcs7KeyLength` | property, read/write | `int CkEmailW_getPkcs7KeyLength(HCkEmailW cHandle); void CkEmailW_putPkcs7KeyLength(HCkEmailW cHandle, int newVal);` |
| `PreferredCharset` | property, read/write | `void CkEmailW_getPreferredCharset(HCkEmailW cHandle, HCkString retval); void CkEmailW_putPreferredCharset(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_preferredCharset(HCkEmailW cHandle);` |
| `PrependHeaders` | property, read/write | `BOOL CkEmailW_getPrependHeaders(HCkEmailW cHandle); void CkEmailW_putPrependHeaders(HCkEmailW cHandle, BOOL newVal);` |
| `ReceivedEncrypted` | property, read-only | `BOOL CkEmailW_getReceivedEncrypted(HCkEmailW cHandle);` |
| `ReceivedSigned` | property, read-only | `BOOL CkEmailW_getReceivedSigned(HCkEmailW cHandle);` |
| `ReplyTo` | property, read/write | `void CkEmailW_getReplyTo(HCkEmailW cHandle, HCkString retval); void CkEmailW_putReplyTo(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_replyTo(HCkEmailW cHandle);` |
| `ReturnReceipt` | property, read/write | `BOOL CkEmailW_getReturnReceipt(HCkEmailW cHandle); void CkEmailW_putReturnReceipt(HCkEmailW cHandle, BOOL newVal);` |
| `SendEncrypted` | property, read/write | `BOOL CkEmailW_getSendEncrypted(HCkEmailW cHandle); void CkEmailW_putSendEncrypted(HCkEmailW cHandle, BOOL newVal);` |
| `SendSigned` | property, read/write | `BOOL CkEmailW_getSendSigned(HCkEmailW cHandle); void CkEmailW_putSendSigned(HCkEmailW cHandle, BOOL newVal);` |
| `SignaturesValid` | property, read-only | `BOOL CkEmailW_getSignaturesValid(HCkEmailW cHandle);` |
| `SignedBy` | property, read-only | `void CkEmailW_getSignedBy(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_signedBy(HCkEmailW cHandle);` |
| `SigningAlg` | property, read/write | `void CkEmailW_getSigningAlg(HCkEmailW cHandle, HCkString retval); void CkEmailW_putSigningAlg(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_signingAlg(HCkEmailW cHandle);` |
| `SigningHashAlg` | property, read/write | `void CkEmailW_getSigningHashAlg(HCkEmailW cHandle, HCkString retval); void CkEmailW_putSigningHashAlg(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_signingHashAlg(HCkEmailW cHandle);` |
| `Size` | property, read-only | `int CkEmailW_getSize(HCkEmailW cHandle);` |
| `Subject` | property, read/write | `void CkEmailW_getSubject(HCkEmailW cHandle, HCkString retval); void CkEmailW_putSubject(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_subject(HCkEmailW cHandle);` |
| `Uidl` | property, read-only | `void CkEmailW_getUidl(HCkEmailW cHandle, HCkString retval); const wchar_t *CkEmailW_uidl(HCkEmailW cHandle);` |
| `UncommonOptions` | property, read/write | `void CkEmailW_getUncommonOptions(HCkEmailW cHandle, HCkString retval); void CkEmailW_putUncommonOptions(HCkEmailW cHandle, const wchar_t *newVal); const wchar_t *CkEmailW_uncommonOptions(HCkEmailW cHandle);` |
| `UnpackUseRelPaths` | property, read/write | `BOOL CkEmailW_getUnpackUseRelPaths(HCkEmailW cHandle); void CkEmailW_putUnpackUseRelPaths(HCkEmailW cHandle, BOOL newVal);` |
| `AddAttachmentBd` | method | `BOOL CkEmailW_AddAttachmentBd(HCkEmailW cHandle, const wchar_t *filename, HCkBinDataW binData, const wchar_t *contentType);` |
| `AddAttachmentHeader` | method | `void CkEmailW_AddAttachmentHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *fieldValue);` |
| `AddBcc` | method | `BOOL CkEmailW_AddBcc(HCkEmailW cHandle, const wchar_t *friendlyName, const wchar_t *emailAddress);` |
| `AddCC` | method | `BOOL CkEmailW_AddCC(HCkEmailW cHandle, const wchar_t *friendlyName, const wchar_t *emailAddress);` |
| `AddEncryptCert` | method | `BOOL CkEmailW_AddEncryptCert(HCkEmailW cHandle, HCkCertW cert);` |
| `AddFileAttachment` | method | `BOOL CkEmailW_AddFileAttachment(HCkEmailW cHandle, const wchar_t *path, const wchar_t *outStrContentType); const wchar_t *CkEmailW_addFileAttachment(HCkEmailW cHandle, const wchar_t *path);` |
| `AddFileAttachment2` | method | `BOOL CkEmailW_AddFileAttachment2(HCkEmailW cHandle, const wchar_t *path, const wchar_t *contentType);` |
| `AddHeaderField` | method | `void CkEmailW_AddHeaderField(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *fieldValue);` |
| `AddHeaderField2` | method | `void CkEmailW_AddHeaderField2(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *fieldValue);` |
| `AddHtmlAlternativeBody` | method | `BOOL CkEmailW_AddHtmlAlternativeBody(HCkEmailW cHandle, const wchar_t *body);` |
| `AddiCalendarAlternativeBody` | method | `BOOL CkEmailW_AddiCalendarAlternativeBody(HCkEmailW cHandle, const wchar_t *icalContent, const wchar_t *methodName);` |
| `AddMultipleBcc` | method | `BOOL CkEmailW_AddMultipleBcc(HCkEmailW cHandle, const wchar_t *commaSeparatedAddresses);` |
| `AddMultipleCC` | method | `BOOL CkEmailW_AddMultipleCC(HCkEmailW cHandle, const wchar_t *commaSeparatedAddresses);` |
| `AddMultipleTo` | method | `BOOL CkEmailW_AddMultipleTo(HCkEmailW cHandle, const wchar_t *commaSeparatedAddresses);` |
| `AddPfxSourceBd` | method | `BOOL CkEmailW_AddPfxSourceBd(HCkEmailW cHandle, HCkBinDataW bd, const wchar_t *password);` |
| `AddPfxSourceFile` | method | `BOOL CkEmailW_AddPfxSourceFile(HCkEmailW cHandle, const wchar_t *pfxFilePath, const wchar_t *pfxPassword);` |
| `AddPlainTextAlternativeBody` | method | `BOOL CkEmailW_AddPlainTextAlternativeBody(HCkEmailW cHandle, const wchar_t *body);` |
| `AddRelatedBd` | method | `BOOL CkEmailW_AddRelatedBd(HCkEmailW cHandle, const wchar_t *filename, HCkBinDataW binData, const wchar_t *outStr); const wchar_t *CkEmailW_addRelatedBd(HCkEmailW cHandle, const wchar_t *filename, HCkBinDataW binData);` |
| `AddRelatedBd2` | method | `BOOL CkEmailW_AddRelatedBd2(HCkEmailW cHandle, HCkBinDataW binData, const wchar_t *fileNameInHtml);` |
| `AddRelatedFile` | method | `BOOL CkEmailW_AddRelatedFile(HCkEmailW cHandle, const wchar_t *path, const wchar_t *outStrContentID); const wchar_t *CkEmailW_addRelatedFile(HCkEmailW cHandle, const wchar_t *path);` |
| `AddRelatedFile2` | method | `BOOL CkEmailW_AddRelatedFile2(HCkEmailW cHandle, const wchar_t *filenameOnDisk, const wchar_t *filenameInHtml);` |
| `AddRelatedHeader` | method | `void CkEmailW_AddRelatedHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *fieldValue);` |
| `AddRelatedString` | method | `BOOL CkEmailW_AddRelatedString(HCkEmailW cHandle, const wchar_t *nameInHtml, const wchar_t *str, const wchar_t *charset, const wchar_t *outCid); const wchar_t *CkEmailW_addRelatedString(HCkEmailW cHandle, const wchar_t *nameInHtml, const wchar_t *str, const wchar_t *charset);` |
| `AddRelatedString2` | method | `void CkEmailW_AddRelatedString2(HCkEmailW cHandle, const wchar_t *fileNameInHtml, const wchar_t *content, const wchar_t *charset);` |
| `AddStringAttachment` | method | `BOOL CkEmailW_AddStringAttachment(HCkEmailW cHandle, const wchar_t *path, const wchar_t *content);` |
| `AddStringAttachment2` | method | `BOOL CkEmailW_AddStringAttachment2(HCkEmailW cHandle, const wchar_t *path, const wchar_t *content, const wchar_t *charset);` |
| `AddTo` | method | `BOOL CkEmailW_AddTo(HCkEmailW cHandle, const wchar_t *friendlyName, const wchar_t *emailAddress);` |
| `AesDecrypt` | method | `BOOL CkEmailW_AesDecrypt(HCkEmailW cHandle, const wchar_t *password);` |
| `AesEncrypt` | method | `BOOL CkEmailW_AesEncrypt(HCkEmailW cHandle, const wchar_t *password);` |
| `AppendToBody` | method | `void CkEmailW_AppendToBody(HCkEmailW cHandle, const wchar_t *str);` |
| `ApplyFixups` | method | `BOOL CkEmailW_ApplyFixups(HCkEmailW cHandle, const wchar_t *fixups);` |
| `AspUnpack` | method | `BOOL CkEmailW_AspUnpack(HCkEmailW cHandle, const wchar_t *prefix, const wchar_t *saveDir, const wchar_t *urlPath, BOOL cleanFiles);` |
| `AttachEmail` | method | `BOOL CkEmailW_AttachEmail(HCkEmailW cHandle, HCkEmailW email);` |
| `BEncodeString` | method | `BOOL CkEmailW_BEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset, const wchar_t *outEncodedStr); const wchar_t *CkEmailW_bEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset);` |
| `Clear` | method | `void CkEmailW_Clear(HCkEmailW cHandle);` |
| `ClearBcc` | method | `void CkEmailW_ClearBcc(HCkEmailW cHandle);` |
| `ClearCC` | method | `void CkEmailW_ClearCC(HCkEmailW cHandle);` |
| `ClearEncryptCerts` | method | `void CkEmailW_ClearEncryptCerts(HCkEmailW cHandle);` |
| `ClearTo` | method | `void CkEmailW_ClearTo(HCkEmailW cHandle);` |
| `ComputeGlobalKey2` | method | `BOOL CkEmailW_ComputeGlobalKey2(HCkEmailW cHandle, const wchar_t *encoding, BOOL bFold, const wchar_t *outStr); const wchar_t *CkEmailW_computeGlobalKey2(HCkEmailW cHandle, const wchar_t *encoding, BOOL bFold);` |
| `ConvertInlineImages` | method | `BOOL CkEmailW_ConvertInlineImages(HCkEmailW cHandle);` |
| `CreateTempMht` | method | `BOOL CkEmailW_CreateTempMht(HCkEmailW cHandle, const wchar_t *inFilename, const wchar_t *outPath); const wchar_t *CkEmailW_createTempMht(HCkEmailW cHandle, const wchar_t *inFilename);` |
| `DropAttachments` | method | `void CkEmailW_DropAttachments(HCkEmailW cHandle);` |
| `DropRelatedItem` | method | `void CkEmailW_DropRelatedItem(HCkEmailW cHandle, int index);` |
| `DropRelatedItems` | method | `void CkEmailW_DropRelatedItems(HCkEmailW cHandle);` |
| `DropSingleAttachment` | method | `BOOL CkEmailW_DropSingleAttachment(HCkEmailW cHandle, int index);` |
| `GenerateFilename` | method | `BOOL CkEmailW_GenerateFilename(HCkEmailW cHandle, const wchar_t *outStrFilename); const wchar_t *CkEmailW_generateFilename(HCkEmailW cHandle);` |
| `GetAlternativeBody` | method | `BOOL CkEmailW_GetAlternativeBody(HCkEmailW cHandle, int index, const wchar_t *outStrBody); const wchar_t *CkEmailW_getAlternativeBody(HCkEmailW cHandle, int index);` |
| `GetAlternativeBodyBd` | method | `BOOL CkEmailW_GetAlternativeBodyBd(HCkEmailW cHandle, int index, HCkBinDataW binData);` |
| `GetAlternativeBodyByContentType` | method | `BOOL CkEmailW_GetAlternativeBodyByContentType(HCkEmailW cHandle, const wchar_t *contentType, const wchar_t *outStr); const wchar_t *CkEmailW_getAlternativeBodyByContentType(HCkEmailW cHandle, const wchar_t *contentType);` |
| `GetAlternativeContentType` | method | `BOOL CkEmailW_GetAlternativeContentType(HCkEmailW cHandle, int index, const wchar_t *outStrContentType); const wchar_t *CkEmailW_getAlternativeContentType(HCkEmailW cHandle, int index);` |
| `GetAltHeaderField` | method | `BOOL CkEmailW_GetAltHeaderField(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *outStr); const wchar_t *CkEmailW_getAltHeaderField(HCkEmailW cHandle, int index, const wchar_t *fieldName);` |
| `GetAttachedEmail` | method | `BOOL CkEmailW_GetAttachedEmail(HCkEmailW cHandle, int index, HCkEmailW email);` |
| `GetAttachedMessageAttr` | method | `BOOL CkEmailW_GetAttachedMessageAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName, const wchar_t *outStr); const wchar_t *CkEmailW_getAttachedMessageAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName);` |
| `GetAttachedMessageFilename` | method | `BOOL CkEmailW_GetAttachedMessageFilename(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getAttachedMessageFilename(HCkEmailW cHandle, int index);` |
| `GetAttachmentAttr` | method | `BOOL CkEmailW_GetAttachmentAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName, const wchar_t *outStr); const wchar_t *CkEmailW_getAttachmentAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName);` |
| `GetAttachmentBd` | method | `BOOL CkEmailW_GetAttachmentBd(HCkEmailW cHandle, int index, HCkBinDataW binData);` |
| `GetAttachmentContentID` | method | `BOOL CkEmailW_GetAttachmentContentID(HCkEmailW cHandle, int index, const wchar_t *outStrContentID); const wchar_t *CkEmailW_getAttachmentContentID(HCkEmailW cHandle, int index);` |
| `GetAttachmentContentType` | method | `BOOL CkEmailW_GetAttachmentContentType(HCkEmailW cHandle, int index, const wchar_t *outStrContentType); const wchar_t *CkEmailW_getAttachmentContentType(HCkEmailW cHandle, int index);` |
| `GetAttachmentFilename` | method | `BOOL CkEmailW_GetAttachmentFilename(HCkEmailW cHandle, int index, const wchar_t *outStrFilename); const wchar_t *CkEmailW_getAttachmentFilename(HCkEmailW cHandle, int index);` |
| `GetAttachmentHeader` | method | `BOOL CkEmailW_GetAttachmentHeader(HCkEmailW cHandle, int attachIndex, const wchar_t *fieldName, const wchar_t *outFieldValue); const wchar_t *CkEmailW_getAttachmentHeader(HCkEmailW cHandle, int attachIndex, const wchar_t *fieldName);` |
| `GetAttachmentSize` | method | `int CkEmailW_GetAttachmentSize(HCkEmailW cHandle, int index);` |
| `GetAttachmentString` | method | `BOOL CkEmailW_GetAttachmentString(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStr); const wchar_t *CkEmailW_getAttachmentString(HCkEmailW cHandle, int index, const wchar_t *charset);` |
| `GetAttachmentStringCrLf` | method | `BOOL CkEmailW_GetAttachmentStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStrData); const wchar_t *CkEmailW_getAttachmentStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset);` |
| `GetBcc` | method | `BOOL CkEmailW_GetBcc(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getBcc(HCkEmailW cHandle, int index);` |
| `GetBccAddr` | method | `BOOL CkEmailW_GetBccAddr(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getBccAddr(HCkEmailW cHandle, int index);` |
| `GetBccName` | method | `BOOL CkEmailW_GetBccName(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getBccName(HCkEmailW cHandle, int index);` |
| `GetCC` | method | `BOOL CkEmailW_GetCC(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getCC(HCkEmailW cHandle, int index);` |
| `GetCcAddr` | method | `BOOL CkEmailW_GetCcAddr(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getCcAddr(HCkEmailW cHandle, int index);` |
| `GetCcName` | method | `BOOL CkEmailW_GetCcName(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getCcName(HCkEmailW cHandle, int index);` |
| `GetDeliveryStatusInfo` | method | `BOOL CkEmailW_GetDeliveryStatusInfo(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *outFieldValue); const wchar_t *CkEmailW_getDeliveryStatusInfo(HCkEmailW cHandle, const wchar_t *fieldName);` |
| `GetDigestEmail` | method | `BOOL CkEmailW_GetDigestEmail(HCkEmailW cHandle, int index, HCkEmailW email);` |
| `GetDsnInfo` | method | `BOOL CkEmailW_GetDsnInfo(HCkEmailW cHandle, HCkJsonObjectW json);` |
| `GetHeaderField` | method | `BOOL CkEmailW_GetHeaderField(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *outStrFieldData); const wchar_t *CkEmailW_getHeaderField(HCkEmailW cHandle, const wchar_t *fieldName);` |
| `GetHeaderFieldName` | method | `BOOL CkEmailW_GetHeaderFieldName(HCkEmailW cHandle, int index, const wchar_t *outStrFieldName); const wchar_t *CkEmailW_getHeaderFieldName(HCkEmailW cHandle, int index);` |
| `GetHeaderFieldValue` | method | `BOOL CkEmailW_GetHeaderFieldValue(HCkEmailW cHandle, int index, const wchar_t *outStrFieldValue); const wchar_t *CkEmailW_getHeaderFieldValue(HCkEmailW cHandle, int index);` |
| `GetHtmlBody` | method | `BOOL CkEmailW_GetHtmlBody(HCkEmailW cHandle, const wchar_t *outStrBody); const wchar_t *CkEmailW_getHtmlBody(HCkEmailW cHandle);` |
| `GetHtmlBodySb` | method | `BOOL CkEmailW_GetHtmlBodySb(HCkEmailW cHandle, BOOL inlineImageData, HCkStringBuilderW sb);` |
| `GetImapUid` | method | `unsigned long CkEmailW_GetImapUid(HCkEmailW cHandle);` |
| `GetMime` | method | `BOOL CkEmailW_GetMime(HCkEmailW cHandle, const wchar_t *outStrMime); const wchar_t *CkEmailW_getMime(HCkEmailW cHandle);` |
| `GetMimeBd` | method | `BOOL CkEmailW_GetMimeBd(HCkEmailW cHandle, HCkBinDataW bindat);` |
| `GetMimeSb` | method | `BOOL CkEmailW_GetMimeSb(HCkEmailW cHandle, HCkStringBuilderW sb);` |
| `GetNthBinaryPartOfTypeBd` | method | `BOOL CkEmailW_GetNthBinaryPartOfTypeBd(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments, HCkBinDataW bd);` |
| `GetNthContentType` | method | `BOOL CkEmailW_GetNthContentType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments, const wchar_t *outStr); const wchar_t *CkEmailW_getNthContentType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments);` |
| `GetNthTextPartOfType` | method | `BOOL CkEmailW_GetNthTextPartOfType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments, const wchar_t *outStr); const wchar_t *CkEmailW_getNthTextPartOfType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments);` |
| `GetNumPartsOfType` | method | `int CkEmailW_GetNumPartsOfType(HCkEmailW cHandle, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments);` |
| `GetPlainTextBody` | method | `BOOL CkEmailW_GetPlainTextBody(HCkEmailW cHandle, const wchar_t *outStrBody); const wchar_t *CkEmailW_getPlainTextBody(HCkEmailW cHandle);` |
| `GetRelatedAttr` | method | `BOOL CkEmailW_GetRelatedAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName, const wchar_t *outStr); const wchar_t *CkEmailW_getRelatedAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName);` |
| `GetRelatedContentID` | method | `BOOL CkEmailW_GetRelatedContentID(HCkEmailW cHandle, int index, const wchar_t *outStrContentID); const wchar_t *CkEmailW_getRelatedContentID(HCkEmailW cHandle, int index);` |
| `GetRelatedContentLocation` | method | `BOOL CkEmailW_GetRelatedContentLocation(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getRelatedContentLocation(HCkEmailW cHandle, int index);` |
| `GetRelatedContentType` | method | `BOOL CkEmailW_GetRelatedContentType(HCkEmailW cHandle, int index, const wchar_t *outStrContentType); const wchar_t *CkEmailW_getRelatedContentType(HCkEmailW cHandle, int index);` |
| `GetRelatedFilename` | method | `BOOL CkEmailW_GetRelatedFilename(HCkEmailW cHandle, int index, const wchar_t *outStrFilename); const wchar_t *CkEmailW_getRelatedFilename(HCkEmailW cHandle, int index);` |
| `GetRelatedHeader` | method | `BOOL CkEmailW_GetRelatedHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *outStr); const wchar_t *CkEmailW_getRelatedHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName);` |
| `GetRelatedString` | method | `BOOL CkEmailW_GetRelatedString(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStrData); const wchar_t *CkEmailW_getRelatedString(HCkEmailW cHandle, int index, const wchar_t *charset);` |
| `GetRelatedStringCrLf` | method | `BOOL CkEmailW_GetRelatedStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStr); const wchar_t *CkEmailW_getRelatedStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset);` |
| `GetReplacePattern` | method | `BOOL CkEmailW_GetReplacePattern(HCkEmailW cHandle, int index, const wchar_t *outStrPattern); const wchar_t *CkEmailW_getReplacePattern(HCkEmailW cHandle, int index);` |
| `GetReplaceString` | method | `BOOL CkEmailW_GetReplaceString(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getReplaceString(HCkEmailW cHandle, int index);` |
| `GetReplaceString2` | method | `BOOL CkEmailW_GetReplaceString2(HCkEmailW cHandle, const wchar_t *pattern, const wchar_t *outStr); const wchar_t *CkEmailW_getReplaceString2(HCkEmailW cHandle, const wchar_t *pattern);` |
| `GetReport` | method | `BOOL CkEmailW_GetReport(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getReport(HCkEmailW cHandle, int index);` |
| `GetTo` | method | `BOOL CkEmailW_GetTo(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getTo(HCkEmailW cHandle, int index);` |
| `GetToAddr` | method | `BOOL CkEmailW_GetToAddr(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getToAddr(HCkEmailW cHandle, int index);` |
| `GetToName` | method | `BOOL CkEmailW_GetToName(HCkEmailW cHandle, int index, const wchar_t *outStr); const wchar_t *CkEmailW_getToName(HCkEmailW cHandle, int index);` |
| `GetXml` | method | `BOOL CkEmailW_GetXml(HCkEmailW cHandle, const wchar_t *outStrXml); const wchar_t *CkEmailW_getXml(HCkEmailW cHandle);` |
| `HasHeaderMatching` | method | `BOOL CkEmailW_HasHeaderMatching(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *valuePattern, BOOL caseSensitive);` |
| `HasHtmlBody` | method | `BOOL CkEmailW_HasHtmlBody(HCkEmailW cHandle);` |
| `HasPlainTextBody` | method | `BOOL CkEmailW_HasPlainTextBody(HCkEmailW cHandle);` |
| `IsMultipartReport` | method | `BOOL CkEmailW_IsMultipartReport(HCkEmailW cHandle);` |
| `LastDecryptCert` | method | `BOOL CkEmailW_LastDecryptCert(HCkEmailW cHandle, HCkCertW cert);` |
| `LastSignerCert` | method | `BOOL CkEmailW_LastSignerCert(HCkEmailW cHandle, int index, HCkCertW cert);` |
| `LinkedDomains` | method | `BOOL CkEmailW_LinkedDomains(HCkEmailW cHandle, HCkStringTableW domains);` |
| `LoadEml` | method | `BOOL CkEmailW_LoadEml(HCkEmailW cHandle, const wchar_t *mimePath);` |
| `LoadTaskResult` | method | `BOOL CkEmailW_LoadTaskResult(HCkEmailW cHandle, HCkTaskW task);` |
| `LoadXml` | method | `BOOL CkEmailW_LoadXml(HCkEmailW cHandle, const wchar_t *xmlPath);` |
| `LoadXmlString` | method | `BOOL CkEmailW_LoadXmlString(HCkEmailW cHandle, const wchar_t *xmlStr);` |
| `MakeCopy` | method | `BOOL CkEmailW_MakeCopy(HCkEmailW cHandle, HCkEmailW destEmail);` |
| `QEncodeString` | method | `BOOL CkEmailW_QEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset, const wchar_t *outEncodedStr); const wchar_t *CkEmailW_qEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset);` |
| `RemoveAttachedMessage` | method | `void CkEmailW_RemoveAttachedMessage(HCkEmailW cHandle, int idx);` |
| `RemoveAttachedMessages` | method | `void CkEmailW_RemoveAttachedMessages(HCkEmailW cHandle);` |
| `RemoveAttachmentPaths` | method | `void CkEmailW_RemoveAttachmentPaths(HCkEmailW cHandle);` |
| `RemoveHeaderField` | method | `void CkEmailW_RemoveHeaderField(HCkEmailW cHandle, const wchar_t *fieldName);` |
| `RemoveHtmlAlternative` | method | `void CkEmailW_RemoveHtmlAlternative(HCkEmailW cHandle);` |
| `RemovePlainTextAlternative` | method | `void CkEmailW_RemovePlainTextAlternative(HCkEmailW cHandle);` |
| `SaveAllAttachments` | method | `BOOL CkEmailW_SaveAllAttachments(HCkEmailW cHandle, const wchar_t *dirPath);` |
| `SaveAttachedFile` | method | `BOOL CkEmailW_SaveAttachedFile(HCkEmailW cHandle, int index, const wchar_t *dirPath);` |
| `SaveEml` | method | `BOOL CkEmailW_SaveEml(HCkEmailW cHandle, const wchar_t *emlFilePath);` |
| `SaveRelatedItem` | method | `BOOL CkEmailW_SaveRelatedItem(HCkEmailW cHandle, int index, const wchar_t *dirPath);` |
| `SaveXml` | method | `BOOL CkEmailW_SaveXml(HCkEmailW cHandle, const wchar_t *path);` |
| `SetAttachmentCharset` | method | `BOOL CkEmailW_SetAttachmentCharset(HCkEmailW cHandle, int index, const wchar_t *charset);` |
| `SetAttachmentDisposition` | method | `BOOL CkEmailW_SetAttachmentDisposition(HCkEmailW cHandle, int index, const wchar_t *disposition);` |
| `SetAttachmentFilename` | method | `BOOL CkEmailW_SetAttachmentFilename(HCkEmailW cHandle, int index, const wchar_t *filename);` |
| `SetBodyBd` | method | `BOOL CkEmailW_SetBodyBd(HCkEmailW cHandle, HCkBinDataW bd, const wchar_t *contentType, const wchar_t *disposition, const wchar_t *filename);` |
| `SetDecryptCert` | method | `BOOL CkEmailW_SetDecryptCert(HCkEmailW cHandle, HCkCertW cert);` |
| `SetDecryptCert2` | method | `BOOL CkEmailW_SetDecryptCert2(HCkEmailW cHandle, HCkCertW cert, HCkPrivateKeyW key);` |
| `SetDt` | method | `BOOL CkEmailW_SetDt(HCkEmailW cHandle, HCkDateTimeW dt);` |
| `SetEdifactBody` | method | `void CkEmailW_SetEdifactBody(HCkEmailW cHandle, const wchar_t *message, const wchar_t *name, const wchar_t *filename, const wchar_t *charset);` |
| `SetEncryptCert` | method | `BOOL CkEmailW_SetEncryptCert(HCkEmailW cHandle, HCkCertW cert);` |
| `SetFromMimeBd` | method | `BOOL CkEmailW_SetFromMimeBd(HCkEmailW cHandle, HCkBinDataW bindat);` |
| `SetFromMimeSb` | method | `BOOL CkEmailW_SetFromMimeSb(HCkEmailW cHandle, HCkStringBuilderW sb);` |
| `SetFromMimeText` | method | `BOOL CkEmailW_SetFromMimeText(HCkEmailW cHandle, const wchar_t *mimeText);` |
| `SetFromXmlText` | method | `BOOL CkEmailW_SetFromXmlText(HCkEmailW cHandle, const wchar_t *xmlStr);` |
| `SetHtmlBody` | method | `void CkEmailW_SetHtmlBody(HCkEmailW cHandle, const wchar_t *html);` |
| `SetRelatedFilename` | method | `BOOL CkEmailW_SetRelatedFilename(HCkEmailW cHandle, int index, const wchar_t *path);` |
| `SetReplacePattern` | method | `BOOL CkEmailW_SetReplacePattern(HCkEmailW cHandle, const wchar_t *pattern, const wchar_t *replaceString);` |
| `SetSigningCert` | method | `BOOL CkEmailW_SetSigningCert(HCkEmailW cHandle, HCkCertW cert);` |
| `SetSigningCert2` | method | `BOOL CkEmailW_SetSigningCert2(HCkEmailW cHandle, HCkCertW cert, HCkPrivateKeyW key);` |
| `SetTextBody` | method | `void CkEmailW_SetTextBody(HCkEmailW cHandle, const wchar_t *bodyText, const wchar_t *contentType);` |
| `ToDsn` | method | `BOOL CkEmailW_ToDsn(HCkEmailW cHandle, const wchar_t *explanation, const wchar_t *statusFields, BOOL headerOnly, HCkEmailW dsnEmail);` |
| `ToForward` | method | `BOOL CkEmailW_ToForward(HCkEmailW cHandle, HCkEmailW fwdEmail);` |
| `ToMdn` | method | `BOOL CkEmailW_ToMdn(HCkEmailW cHandle, const wchar_t *message, const wchar_t *statusFields, BOOL headerOnly, HCkEmailW mdn);` |
| `ToReply` | method | `BOOL CkEmailW_ToReply(HCkEmailW cHandle, HCkEmailW reply);` |
| `UidlEquals` | method | `BOOL CkEmailW_UidlEquals(HCkEmailW cHandle, HCkEmailW e);` |
| `UnpackHtml` | method | `BOOL CkEmailW_UnpackHtml(HCkEmailW cHandle, const wchar_t *unpackDir, const wchar_t *htmlFilename, const wchar_t *partsSubdir);` |
| `UnSpamify` | method | `void CkEmailW_UnSpamify(HCkEmailW cHandle);` |
| `UnzipAttachments` | method | `BOOL CkEmailW_UnzipAttachments(HCkEmailW cHandle);` |
| `UseCertVault` | method | `BOOL CkEmailW_UseCertVault(HCkEmailW cHandle, HCkXmlCertVaultW vault);` |
| `ZipAttachments` | method | `BOOL CkEmailW_ZipAttachments(HCkEmailW cHandle, const wchar_t *zipFilename);` |

Deprecated members are listed at the end of this file with their replacements; do not use them in new code.

## Properties

### Email.Body

`Chilkat 11.7.0 · wc · Email · Body · property · read/write`

```c
void CkEmailW_getBody(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putBody(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_body(HCkEmailW cHandle);
```

Gets or sets the primary body of the email.

When reading this property, an email containing both plain-text and HTML alternatives returns the HTML body. Use `GetHtmlBody` or `GetPlainTextBody` to retrieve a specific representation, and use `HasHtmlBody` or `HasPlainTextBody` to determine which representations are present.

When setting this property, Chilkat inspects the supplied content to determine the body type. If the content is recognized as HTML, the HTML body is set. Otherwise, the plain-text body is set. If the email contains both plain-text and HTML alternatives, the corresponding alternative is replaced and the other alternative is left unchanged.

For explicit control, use `SetTextBody`, `SetHtmlBody`, `AddPlainTextAlternativeBody`, or `AddHtmlAlternativeBody`.

### Email.Charset

`Chilkat 11.7.0 · wc · Email · Charset · property · read/write`

```c
void CkEmailW_getCharset(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putCharset(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_charset(HCkEmailW cHandle);
```

Represents the main charset of the email, such as `utf-8`, `iso-8859-1`, `Shift_JIS`, `US-ASCII`, etc. This property can be empty if there is no explicit charset, such as for emails with only US-ASCII.

Setting this property causes Chilkat to use the new charset in HTML and plain-text bodies, where possible. This can include updating the HTML META tag in HTML bodies to agree with the charset specified in the email header and also the byte representation of the HTML body in the email.

Chilkat stores text internally as Unicode. This property mainly controls how body text is converted to bytes and labeled when MIME is generated.

### Email.Decrypted

`Chilkat 11.7.0 · wc · Email · Decrypted · property · read-only`

```c
BOOL CkEmailW_getDecrypted(HCkEmailW cHandle);
```

`TRUE` if the email arrived encrypted and was successfully decrypted, otherwise `FALSE`. This property is only meaningful when the `ReceivedEncrypted` property is equal to `TRUE`.

Check `ReceivedEncrypted` first. A value of `FALSE` can mean either that the message was not encrypted or that decryption did not succeed.

### Email.EmailDateStr

`Chilkat 11.7.0 · wc · Email · EmailDateStr · property · read/write`

```c
void CkEmailW_getEmailDateStr(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putEmailDateStr(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_emailDateStr(HCkEmailW cHandle);
```

The date/time from the `Date` header in the UTC/GMT timezone in RFC822 string form.

For example: `Fri, 10 Jul 2026 20:15:30 GMT`.

Setting this property updates the email's `Date` header.

### Email.EncryptedBy

`Chilkat 11.7.0 · wc · Email · EncryptedBy · property · read-only`

```c
void CkEmailW_getEncryptedBy(HCkEmailW cHandle, HCkString retval);
const wchar_t *CkEmailW_encryptedBy(HCkEmailW cHandle);
```

If the email was received encrypted, this contains the details of the certificate used for encryption.

This property is meaningful only when `ReceivedEncrypted` is `TRUE`. To obtain a certificate object rather than descriptive text, use `GetEncryptedByCert` or `LastDecryptCert`.

### Email.FileDistList

`Chilkat 11.7.0 · wc · Email · FileDistList · property · read/write`

```c
void CkEmailW_getFileDistList(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putFileDistList(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_fileDistList(HCkEmailW cHandle);
```

Set this property to send an email to a list of recipients stored in a plain text file. The file format is simple: one recipient per line, no comments allowed, blank lines are ignored. Setting this property is equivalent to adding a `CKX-FileDistList` header field to the email. `MailMan` treats header fields beginning with `CKX-` specially in that these fields are never transmitted with the email when sent. However, CKX fields are saved and restored when saving to XML or loading from XML (or MIME). When sending an email containing a `CKX-FileDistList` header field, `MailMan` will read the distribution list file and send the email to each recipient. Emails can be sent individually, or with BCC, 100 recipients at a time. (See the `MailMan.SendIndividual` property.)

The distribution-list file is read when the message is sent, so the file must still exist and be accessible at that time. This feature is separate from the recipients stored in the normal To, Cc, and Bcc lists.

### Email.From

`Chilkat 11.7.0 · wc · Email · From · property · read/write`

```c
void CkEmailW_getFrom(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putFrom(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_from(HCkEmailW cHandle);
```

Contains the sender name and email address as they appear in the `From` header, such as `John Smith <john.smith@mail.com>`.

If the sender identified by the `Sender` header field should differ from the visible `From` address, call `AddHeaderField` to set the `Sender` header field.

`From`, `FromName`, and `FromAddress` are different views of the same MIME `From` header.

### Email.FromAddress

`Chilkat 11.7.0 · wc · Email · FromAddress · property · read/write`

```c
void CkEmailW_getFromAddress(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putFromAddress(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_fromAddress(HCkEmailW cHandle);
```

The email address of the sender.

Changing this property updates the address portion of the MIME `From` header while preserving the sender name when possible.

### Email.FromName

`Chilkat 11.7.0 · wc · Email · FromName · property · read/write`

```c
void CkEmailW_getFromName(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putFromName(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_fromName(HCkEmailW cHandle);
```

The name of the sender.

Changing this property updates the display-name portion of the MIME `From` header while preserving the email address.

### Email.Header

`Chilkat 11.7.0 · wc · Email · Header · property · read-only`

```c
void CkEmailW_getHeader(HCkEmailW cHandle, HCkString retval);
const wchar_t *CkEmailW_header(HCkEmailW cHandle);
```

The complete MIME header of the email.

This is the header generated from the current in-memory email object. Modify individual fields through the corresponding properties or header methods rather than attempting to assign to this read-only property.

### Email.Language

`Chilkat 11.7.0 · wc · Email · Language · property · read-only`

```c
void CkEmailW_getLanguage(HCkEmailW cHandle, HCkString retval);
const wchar_t *CkEmailW_language(HCkEmailW cHandle);
```

Identifies the primary language group detected in the email subject and body text.

- `latin1` — English and Western European languages
- `central` — Central European languages, such as Polish, Czech, and Hungarian
- `russian` — Cyrillic languages
- `greek`, `turkish`, `hebrew`, `arabic`, `thai`, or `vietnamese`
- `chinese`, `japanese`, or `korean`
- `devanagari`, `bengali`, `gurmukhi`, `gujarati`, `oriya`, `tamil`, `telugu`, `kannada`, `malayalam`, or `sinhala`
- `lao`, `tibetan`, `myanmar`, or `georgian`
- `unknown`

Characters in address and other MIME header fields are not considered. The `Subject` header has the greatest influence on the result. For example, an email with Japanese text in the subject and Russian text in the body is classified as `japanese`.

The classification is based on the Unicode blocks containing the characters found in the email.

This is a character-based heuristic intended to help choose encodings. It is not taken from the MIME `Content-Language` header and should not be treated as formal language detection.

### Email.LocalDateStr

`Chilkat 11.7.0 · wc · Email · LocalDateStr · property · read/write`

```c
void CkEmailW_getLocalDateStr(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putLocalDateStr(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_localDateStr(HCkEmailW cHandle);
```

The date/time found in the `Date` header field returned in the local timezone in RFC822 string form.

For example: `Fri, 10 Jul 2026 15:15:30 -0500`.

Setting this property updates the email's `Date` header. Use `LocalDate` when a native local date/time value is preferred.

### Email.Mailer

`Chilkat 11.7.0 · wc · Email · Mailer · property · read/write`

```c
void CkEmailW_getMailer(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putMailer(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_mailer(HCkEmailW cHandle);
```

Identifies the email software that sent the email.

This corresponds to the MIME `X-Mailer` header, which is informational and may be absent or supplied by the sending application.

### Email.NumAlternatives

`Chilkat 11.7.0 · wc · Email · NumAlternatives · property · read-only`

```c
int CkEmailW_getNumAlternatives(HCkEmailW cHandle);
```

The number of body representations present in the email. A representation may be plain text, HTML, iCalendar, or another body format.

A normal email with one body generally returns `1`. A `multipart/alternative` email returns the number of alternatives contained in that enclosure. A newly created or cleared `Email` object also reports `1` for its default empty text body.

An alternative is one of multiple representations of the same email body, such as plain text and HTML, within a `multipart/alternative` message.

For example, an email containing plain-text and HTML alternatives, inline images, and an attachment may have a MIME structure similar to:

```
multipart/mixed
  multipart/alternative
    text/plain
    multipart/related
      text/html
      image/png
  application/pdf
```

In this example, the `text/plain` part and the `multipart/related` part are alternatives. The `multipart/related` part contains the HTML body and an inline image, while the PDF is a separate attachment.

Alternative indexes used by methods such as `GetAlternativeBody` are zero-based.

### Email.NumAttachedMessages

`Chilkat 11.7.0 · wc · Email · NumAttachedMessages · property · read-only`

```c
int CkEmailW_getNumAttachedMessages(HCkEmailW cHandle);
```

The number of embedded emails represented by `message/rfc822` MIME parts.

Some mail clients attach a forwarded message as a complete nested email. These parts are counted separately from ordinary attachments and related items.

Attached-message indexes are zero-based. Use `GetAttachedEmail` to copy an embedded message into another `Email` object. The deprecated `GetAttachedMessage` method also returns an independent copy.

### Email.NumAttachments

`Chilkat 11.7.0 · wc · Email · NumAttachments · property · read-only`

```c
int CkEmailW_getNumAttachments(HCkEmailW cHandle);
```

The number of ordinary attachments contained in the email.

Attachment indexes are zero-based. Related resources contained within a `multipart/related` enclosure are counted separately by `NumRelatedItems`, and embedded `message/rfc822` emails are counted by `NumAttachedMessages`.

A MIME part outside a `multipart/related` enclosure may be classified as an attachment even when it does not explicitly contain `Content-Disposition: attachment`. MIME structure, content type, and disposition are considered together.

**Note:** If an email is downloaded from an `Imap` server without attachment data, use the `Imap` method that reports attachment information for the server message. This property reports only the attachments actually present in the current `Email` object.

See also:

- [Email Attachment Not Found?](http://www.cknotes.com/?p=280)
- [POP3 Headers and Attachment Info](http://www.cknotes.com/?p=85)
- [Email Attachment Info when Downloading from IMAP without Attachments](http://www.cknotes.com/?p=434)

### Email.NumBcc

`Chilkat 11.7.0 · wc · Email · NumBcc · property · read-only`

```c
int CkEmailW_getNumBcc(HCkEmailW cHandle);
```

The number of blind carbon-copy email recipients.

Bcc recipient indexes are zero-based and can be inspected with `GetBcc`, `GetBccAddr`, and `GetBccName`.

### Email.NumCC

`Chilkat 11.7.0 · wc · Email · NumCC · property · read-only`

```c
int CkEmailW_getNumCC(HCkEmailW cHandle);
```

The number of carbon-copy email recipients.

Cc recipient indexes are zero-based and can be inspected with `GetCC`, `GetCcAddr`, and `GetCcName`.

### Email.NumDaysOld

`Chilkat 11.7.0 · wc · Email · NumDaysOld · property · read-only`

```c
int CkEmailW_getNumDaysOld(HCkEmailW cHandle);
```

Returns the number of days old from the current system date/time. The email's date is obtained from the `Date` header field. If the `Date` header field is missing, or invalid, then -9999 is returned. A negative number may be returned if the `Date` header field contains a future date/time. (However, -9999 represents an error condition.)

The calculation uses the parsed `Date` header, not the time when the message was downloaded or loaded into the object.

### Email.NumDigests

`Chilkat 11.7.0 · wc · Email · NumDigests · property · read-only · since 9.5.0.66`

```c
int CkEmailW_getNumDigests(HCkEmailW cHandle);
```

Returns the number of message/rfc822 parts contained within the multipart/digest enclosure. If no multipart/digest enclosure exists, then this property has the value of 0. The `GetDigest` method is called to get the Nth digest as an email object.

Digest indexes are zero-based. Use `GetDigestEmail` to retrieve an individual message from the digest.

### Email.NumHeaderFields

`Chilkat 11.7.0 · wc · Email · NumHeaderFields · property · read-only`

```c
int CkEmailW_getNumHeaderFields(HCkEmailW cHandle);
```

The number of header fields. When accessing a header field by index, the first header field is at index 0, and the last is at NumHeaderFields-1. (Chilkat indexing is always 0-based.)

Repeated header fields are counted separately. Use `GetHeaderFieldName` and `GetHeaderFieldValue` to enumerate them by zero-based index.

### Email.NumRelatedItems

`Chilkat 11.7.0 · wc · Email · NumRelatedItems · property · read-only`

```c
int CkEmailW_getNumRelatedItems(HCkEmailW cHandle);
```

The number of related MIME items present in the email. Related items are resources, such as images or style sheets, contained with an HTML body in a `multipart/related` enclosure.

Related-item indexes are zero-based. These parts are distinct from ordinary attachments and are commonly referenced by HTML using a `cid:` URL or a `Content-Location` value.

Classification is based primarily on the MIME structure. An inline disposition or `Content-ID` alone does not necessarily make a part a related item if it is outside the relevant `multipart/related` enclosure.

### Email.NumReplacePatterns

`Chilkat 11.7.0 · wc · Email · NumReplacePatterns · property · read-only`

```c
int CkEmailW_getNumReplacePatterns(HCkEmailW cHandle);
```

Returns the number of replacement patterns previously set by calling the `SetReplacePattern` method 1 or more times. If replacement patterns are set, the email bodies and header fields are modified by applying the search/replacement strings during the message sending process.

Pattern indexes are zero-based. Replacement patterns are retained in the email object and applied later during supported mail-merge sending operations.

### Email.NumReports

`Chilkat 11.7.0 · wc · Email · NumReports · property · read-only`

```c
int CkEmailW_getNumReports(HCkEmailW cHandle);
```

Contains the number of report parts in a `multipart/report` email.

A MIME part is counted as a report when its `Content-Type` is `message/*`, except for `message/rfc822`, or when its `Content-Type` is `text/rfc822-headers`. A `message/rfc822` part is treated as an attached email and is counted by `NumAttachedMessages`.

Use `GetReport` to retrieve the body of each report part.

Report indexes are zero-based. Use `GetReport` to retrieve the content of an individual report part.

### Email.NumTo

`Chilkat 11.7.0 · wc · Email · NumTo · property · read-only`

```c
int CkEmailW_getNumTo(HCkEmailW cHandle);
```

The number of direct email recipients.

To-recipient indexes are zero-based and can be inspected with `GetTo`, `GetToAddr`, and `GetToName`.

### Email.OaepHash

`Chilkat 11.7.0 · wc · Email · OaepHash · property · read/write · since 9.5.0.67`

```c
void CkEmailW_getOaepHash(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putOaepHash(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_oaepHash(HCkEmailW cHandle);
```

Selects the hash algorithm used by OAEP padding when encrypting email with RSAES-OAEP. Valid values are `sha1`, `sha256`, `sha384`, and `sha512`. The default is `sha256`.

This property is used only when `OaepPadding` is `TRUE`.

### Email.OaepMgfHash

`Chilkat 11.7.0 · wc · Email · OaepMgfHash · property · read/write · since 9.5.0.71`

```c
void CkEmailW_getOaepMgfHash(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putOaepMgfHash(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_oaepMgfHash(HCkEmailW cHandle);
```

Selects the mask-generation function (MGF) hash algorithm used by OAEP padding when encrypting email with RSAES-OAEP. Valid values are `sha1`, `sha256`, `sha384`, and `sha512`. The default is `sha256`.

This property is used only when `OaepPadding` is `TRUE`. Some recipients require the MGF hash to match `OaepHash`.

### Email.OaepPadding

`Chilkat 11.7.0 · wc · Email · OaepPadding · property · read/write · since 9.5.0.67`

```c
BOOL CkEmailW_getOaepPadding(HCkEmailW cHandle);
void CkEmailW_putOaepPadding(HCkEmailW cHandle, BOOL newVal);
```

Selects the RSA encryption scheme when encrypting email. The default value is `FALSE`, which selects RSAES_PKCS1-V1_5. When set to `TRUE`, RSAES_OAEP is used.

This affects the RSA key-encryption step used for S/MIME encryption; it does not change the symmetric content-encryption algorithm selected by `Pkcs7CryptAlg`.

### Email.OverwriteExisting

`Chilkat 11.7.0 · wc · Email · OverwriteExisting · property · read/write`

```c
BOOL CkEmailW_getOverwriteExisting(HCkEmailW cHandle);
void CkEmailW_putOverwriteExisting(HCkEmailW cHandle, BOOL newVal);
```

When `TRUE` (the default) the methods to save email attachments and related items will overwrite files if they already exist. When `FALSE`, the methods that save email attachments and related items will append a string of 4 characters to create a unique filename if a file already exists. The filename of the attachment (or related item) within the email object is updated and can be retrieved by the program to determine the actual file(s) created.

This setting applies only when attachments or related items are written to the filesystem. When `FALSE` and a name collision occurs during a save operation, Chilkat chooses a unique filename and updates the corresponding filename stored in the email object.

### Email.Pkcs7CryptAlg

`Chilkat 11.7.0 · wc · Email · Pkcs7CryptAlg · property · read/write`

```c
void CkEmailW_getPkcs7CryptAlg(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putPkcs7CryptAlg(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_pkcs7CryptAlg(HCkEmailW cHandle);
```

When an email is sent encrypted (using PKCS#7 public-key encryption), this selects the underlying symmetric encryption algorithm. Possible values are: `aes`, `aes-gcm`, `des`, `3des`, and `rc2`. The default value is `aes`.

**Note:** The `aes-gcm` option was added in Chilkat v10.0.0

This setting is used when S/MIME encryption is generated, typically after `SendEncrypted` is set to `TRUE` and recipient encryption certificates have been supplied.

### Email.Pkcs7KeyLength

`Chilkat 11.7.0 · wc · Email · Pkcs7KeyLength · property · read/write`

```c
int CkEmailW_getPkcs7KeyLength(HCkEmailW cHandle);
void CkEmailW_putPkcs7KeyLength(HCkEmailW cHandle, int newVal);
```

When the email is sent encrypted using PKCS#7 public-key encryption, this selects the key length of the underlying symmetric encryption algorithm. The default value is `128`.

The allowed values depend on `Pkcs7CryptAlg`:

- For `aes`, use `128`, `192`, or `256`.
- For `3des`, use `192`.
- For `des`, use `40`.
- For `rc2`, use `40`, `56`, `64`, or `128`.

An unsupported algorithm and key-length combination causes the encryption operation to fail.

### Email.PreferredCharset

`Chilkat 11.7.0 · wc · Email · PreferredCharset · property · read/write`

```c
void CkEmailW_getPreferredCharset(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putPreferredCharset(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_preferredCharset(HCkEmailW cHandle);
```

Only applies when building an email with non-English characters where the charset is not explicitly set. The Chilkat email component will automatically choose a charset based on the languages found within an email (if the charset is not already specified within the MIME or explicitly specified by setting the `Charset` property). The default charset chosen for each language is:

Chinese: `gb2312`  
Japanese: `shift_JIS`  
Korean: `ks_c_5601-1987`  
Thai: `windows-874`  
All others: `iso-8859-*`

This allows for charsets such as iso-2022-jp to be chosen instead of the default. If the preferred charset does not apply to the situation, it is not used. For example, if the preferred charset is iso-2022-jp, but the email contains Greek characters, then the preferred charset is ignored.

This is a preference, not a forced conversion. It is ignored when the message already specifies a charset or when the requested charset cannot represent the email text.

### Email.PrependHeaders

`Chilkat 11.7.0 · wc · Email · PrependHeaders · property · read/write`

```c
BOOL CkEmailW_getPrependHeaders(HCkEmailW cHandle);
void CkEmailW_putPrependHeaders(HCkEmailW cHandle, BOOL newVal);
```

When `TRUE`, header fields added via the `AddHeaderField` or `AddHeaderField2` methods are prepended to the top of the header as opposed to appended to the bottom. The default value is `FALSE`.

This affects header fields added after the property is set. It does not reorder fields that are already present.

### Email.ReceivedEncrypted

`Chilkat 11.7.0 · wc · Email · ReceivedEncrypted · property · read-only`

```c
BOOL CkEmailW_getReceivedEncrypted(HCkEmailW cHandle);
```

`TRUE` if this email was originally received with encryption, otherwise `FALSE`.

This records how the message was originally received. It remains useful after successful automatic decryption, when the visible body is already the decrypted content.

### Email.ReceivedSigned

`Chilkat 11.7.0 · wc · Email · ReceivedSigned · property · read-only`

```c
BOOL CkEmailW_getReceivedSigned(HCkEmailW cHandle);
```

`TRUE` if this email was originally received with a digital signature, otherwise `FALSE`.

This records whether the original message contained one or more digital signatures. Use `SignaturesValid` to determine whether the signed content verified successfully.

### Email.ReplyTo

`Chilkat 11.7.0 · wc · Email · ReplyTo · property · read/write`

```c
void CkEmailW_getReplyTo(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putReplyTo(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_replyTo(HCkEmailW cHandle);
```

Sets the `Reply-To` header field to the specified email address such as `john@example.com`. The `Reply-To` header automatically defaults to the `From` email address. You would only set this property if you wish for the `Reply-To` email address to be different from the `From` address.

There is usually only a single `Reply-To` email address. If multiple `Reply-To` addresses are needed, then set with a comma-separated list of email addresses such as `john@example.com, mary@somewhere.com`.

This changes the MIME `Reply-To` header only; it does not change the SMTP envelope sender or the visible `From` header.

See also:

- [More Information about Multiple Reply-To Email Addresses](https://cknotes.com/multiple-reply-to-email-addresses/)

### Email.ReturnReceipt

`Chilkat 11.7.0 · wc · Email · ReturnReceipt · property · read/write`

```c
BOOL CkEmailW_getReturnReceipt(HCkEmailW cHandle);
void CkEmailW_putReturnReceipt(HCkEmailW cHandle, BOOL newVal);
```

Set to `TRUE` if you want the email to request a return-receipt when received by the recipient. The default value is `FALSE`.

Setting this property causes the `Disposition-Notification-To` email header to be added when the email is sent.

A return receipt is only a request. The recipient's mail client or server may ignore it, and a receipt is not proof that the message was read by a person.

See also:

- [Explaining Email Return Receipts and Disposition-Notification-To](https://cknotes.com/explaining-email-return-receipts-and-disposition-notification-to/)

### Email.SendEncrypted

`Chilkat 11.7.0 · wc · Email · SendEncrypted · property · read/write`

```c
BOOL CkEmailW_getSendEncrypted(HCkEmailW cHandle);
void CkEmailW_putSendEncrypted(HCkEmailW cHandle, BOOL newVal);
```

Set to `TRUE` if this email should be sent encrypted. The default value is `FALSE`.

Encryption requires one or more recipient certificates, supplied with methods such as `AddEncryptCert` or `SetEncryptCert`. Setting this property alone does not provide a certificate.

### Email.SendSigned

`Chilkat 11.7.0 · wc · Email · SendSigned · property · read/write`

```c
BOOL CkEmailW_getSendSigned(HCkEmailW cHandle);
void CkEmailW_putSendSigned(HCkEmailW cHandle, BOOL newVal);
```

Set to `TRUE` if this email should be sent with a digital signature. The default value is `FALSE`.

Signing requires a certificate with access to its private key, supplied with `SetSigningCert` or `SetSigningCert2`.

**Note:** Please be aware of the Apple Mail bug explained in the webpage at the link below.

See also:

- [Apple Mail Bug: Unable to Verify Message Signature](https://cknotes.com/apple-mail-warning-unable-to-verify-message-signature/)

### Email.SignaturesValid

`Chilkat 11.7.0 · wc · Email · SignaturesValid · property · read-only`

```c
BOOL CkEmailW_getSignaturesValid(HCkEmailW cHandle);
```

`TRUE` if the email was received with one or more digital signatures, and if all the signatures were validated indicating that the email was not altered. Otherwise this property is set to `FALSE`. (This property is only meaningful when the `ReceivedSigned` property is equal to `TRUE`.)

This indicates cryptographic integrity of the signed content. Applications that also require certificate trust should separately examine the signer certificate and its chain.

### Email.SignedBy

`Chilkat 11.7.0 · wc · Email · SignedBy · property · read-only`

```c
void CkEmailW_getSignedBy(HCkEmailW cHandle, HCkString retval);
const wchar_t *CkEmailW_signedBy(HCkEmailW cHandle);
```

If the email was received digitally signed, this property contains the fields of the certificate's SubjectDN.

For example: US, 94105, California, San Francisco, 100 Market Street, Northwind Research LLC, Engineering, Avery Morgan

This is similar to a distinguished name (DN), but without the attribute names, such as `C=`, `ST=`, `L=`, `O=`, and `CN=`, preceding each value.

This is intended for display or diagnostics. Use `LastSignerCert` when the signer certificate itself is needed.

### Email.SigningAlg

`Chilkat 11.7.0 · wc · Email · SigningAlg · property · read/write · since 9.5.0.67`

```c
void CkEmailW_getSigningAlg(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putSigningAlg(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_signingAlg(HCkEmailW cHandle);
```

Selects the signature algorithm to be used when sending signed (PKCS#7) email. The default value is `PKCS1-v1_5`. This can be set to `RSASSA-PSS` (or simply `pss`) to use the RSASSA-PSS signature scheme.

**Note:** This property only applies when signing with an RSA private key. It does not apply for ECC or DSA private keys.

This setting is used only for RSA signing. The selected scheme must also be supported by the private key provider.

### Email.SigningHashAlg

`Chilkat 11.7.0 · wc · Email · SigningHashAlg · property · read/write`

```c
void CkEmailW_getSigningHashAlg(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putSigningHashAlg(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_signingHashAlg(HCkEmailW cHandle);
```

Selects the underlying hash algorithm used when sending signed (PKCS#7) email. Possible values are `sha1`, `sha256`, `sha384`, `sha512`, `md5`, and `md2`. The default is `sha1`.

This property controls the message-digest algorithm placed in the signature. It is used only when a signed message is generated.

### Email.Size

`Chilkat 11.7.0 · wc · Email · Size · property · read-only`

```c
int CkEmailW_getSize(HCkEmailW cHandle);
```

The size in bytes of the email, including all parts and attachments.

**Note:** This property is only valid if the full email was downloaded. If only the header was downloaded, then this property will contain the size of just the header.

This value describes the email data currently present in the object. It should not be used as the server-reported full message size when only a partial message was downloaded.

### Email.Subject

`Chilkat 11.7.0 · wc · Email · Subject · property · read/write`

```c
void CkEmailW_getSubject(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putSubject(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_subject(HCkEmailW cHandle);
```

The email subject.

This property reads or writes the MIME `Subject` header. Chilkat performs the required MIME header encoding when the subject contains non-ASCII characters.

### Email.Uidl

`Chilkat 11.7.0 · wc · Email · Uidl · property · read-only`

```c
void CkEmailW_getUidl(HCkEmailW cHandle, HCkString retval);
const wchar_t *CkEmailW_uidl(HCkEmailW cHandle);
```

Contains the unique message identifier assigned by a POP3 server. The value is also represented by the `X-UIDL` header field.

**Important:** UIDLs are specific to POP3. IMAP uses UIDs instead. An email downloaded through `Chilkat.Imap` stores its IMAP identifier in the `ckx-imap-uid` header. The `ckx-imap-isUid` header contains `YES` when that value is an IMAP UID, or `NO` when it is a mailbox sequence number.

A UIDL identifies a POP3 message within the server's mailbox and is normally used to avoid downloading the same message repeatedly.

### Email.UncommonOptions

`Chilkat 11.7.0 · wc · Email · UncommonOptions · property · read/write · since 9.5.0.79`

```c
void CkEmailW_getUncommonOptions(HCkEmailW cHandle, HCkString retval);
void CkEmailW_putUncommonOptions(HCkEmailW cHandle, const wchar_t *newVal);
const wchar_t *CkEmailW_uncommonOptions(HCkEmailW cHandle);
```

This is a catch-all property to be used for uncommon needs. This property defaults to the empty string, and should typically remain empty.

- `NoBccHeader` - (added in v11.0.0) Do not add the `Bcc` MIME header for BCC email addresses. Note: The `NoBccHeader` keyword must be present before calling `AddBcc` or `AddMultipleBcc`
- `NO_FORMAT_FLOWED` - Don't automatically add `format=flowed` to any `Content-Type` header.

Leave this property empty unless a documented compatibility option is specifically required. Unrecognized keywords should not be assumed to have any effect.

### Email.UnpackUseRelPaths

`Chilkat 11.7.0 · wc · Email · UnpackUseRelPaths · property · read/write`

```c
BOOL CkEmailW_getUnpackUseRelPaths(HCkEmailW cHandle);
void CkEmailW_putUnpackUseRelPaths(HCkEmailW cHandle, BOOL newVal);
```

Applies to the `UnpackHtml` method. When `TRUE`, relative paths are used within the HTML for the links to the related files (images and style sheets) that were unpacked to the filesystem. Otherwise absolute paths are used. The default value is `TRUE`.

Relative paths are usually preferable when the unpacked HTML directory will be moved or deployed as a unit. Absolute paths can be useful for immediate local viewing.

## Methods

### Email.AddAttachmentBd

`Chilkat 11.7.0 · wc · Email · AddAttachmentBd · method · since 9.5.0.63`

```c
BOOL CkEmailW_AddAttachmentBd(HCkEmailW cHandle, const wchar_t *filename, HCkBinDataW binData, const wchar_t *contentType);
```

Adds an attachment using the contents of a `BinData` object. If `contentType` is empty, then the `Content-Type` will be inferred from `filename` extension.

`filename` is the filename stored in MIME, not a filesystem path. The bytes are taken from `binData`.

Returns TRUE for success, FALSE for failure.

### Email.AddAttachmentHeader

`Chilkat 11.7.0 · wc · Email · AddAttachmentHeader · method`

```c
void CkEmailW_AddAttachmentHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *fieldValue);
```

Adds or replaces a MIME header field in one of the email attachments. If the header field does not exist, it is added. Otherwise it is replaced.

**Indexing:** `index` is zero-based and must identify an existing attachment. This changes the attachment MIME header in the current email object; it does not modify the original source file.

### Email.AddBcc

`Chilkat 11.7.0 · wc · Email · AddBcc · method`

```c
BOOL CkEmailW_AddBcc(HCkEmailW cHandle, const wchar_t *friendlyName, const wchar_t *emailAddress);
```

**Full documentation for this method (same in every language):** [BCC Changes in v11.0.0](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/v11_email.md)

Adds a recipient to the blind carbon-copy (BCC) list. `emailAddress` is required; `friendlyName` is optional. Call this method separately for each BCC recipient.

**Note:** Before v11.0.0, BCC addresses are not added to the MIME header. After v11.0.0, BCC addresses are included in the MIME header. Most email servers remove the `BCC` header before delivering the message to regular recipients. The `NoBccHeader` keyword can be used in `UncommonOptions` to prevent BCC email addresses in the MIME passed to the SMTP server. If your application specifies `NoBccHeader`, do so before adding BCC addresses.

The recipient is added to the in-memory message only. The message is not transmitted until it is passed to a sending method of `MailMan`.

Returns TRUE for success, FALSE for failure.

### Email.AddCC

`Chilkat 11.7.0 · wc · Email · AddCC · method`

```c
BOOL CkEmailW_AddCC(HCkEmailW cHandle, const wchar_t *friendlyName, const wchar_t *emailAddress);
```

Adds a recipient to the carbon-copy list. `emailAddress` is required, but `friendlyName` may be empty.

To add multiple CC recipients, call this method once per recipient.

The recipient is added to the in-memory message only. Use `NumCC` and the Cc getter methods to inspect the resulting list.

Returns TRUE for success, FALSE for failure.

### Email.AddEncryptCert

`Chilkat 11.7.0 · wc · Email · AddEncryptCert · method`

```c
BOOL CkEmailW_AddEncryptCert(HCkEmailW cHandle, HCkCertW cert);
```

Allows for certificates to be explicitly specified for sending encrypted email to one or more recipients. Call this method once per certificate to be used. The `ClearEncryptCerts` method may be called to clear the list of explicitly-specified certificates.

**Note:** It is possible to send encrypted email without explicitly specifying the certificates. On Windows, the registry-based Current-User and Local-Machine certificate stores are automatically searched for certificates matching each recipient in the To, CC, and BCC lists. On macOS, the Keychain is automatically searched for matching recipient certificates.

**Note:** The `SetEncryptCert` method is equivalent to calling `ClearEncryptCerts` followed by AddEncryptCert.

Use this method when encrypting for multiple recipients: add each recipient certificate separately. For a single explicitly selected certificate, `SetEncryptCert` may be simpler.

Returns TRUE for success, FALSE for failure.

### Email.AddFileAttachment

`Chilkat 11.7.0 · wc · Email · AddFileAttachment · method`

```c
BOOL CkEmailW_AddFileAttachment(HCkEmailW cHandle, const wchar_t *path, const wchar_t *outStrContentType);
const wchar_t *CkEmailW_addFileAttachment(HCkEmailW cHandle, const wchar_t *path);
```

Adds a file as an attachment to the email. Returns the MIME `Content-Type` of the attachment, which is inferred based on the filename extension.

`path` is a local filesystem path. The file is read and incorporated into the current email object, and the attachment filename placed in MIME is derived from `path`.

Returns TRUE for success, FALSE for failure.

### Email.AddFileAttachment2

`Chilkat 11.7.0 · wc · Email · AddFileAttachment2 · method`

```c
BOOL CkEmailW_AddFileAttachment2(HCkEmailW cHandle, const wchar_t *path, const wchar_t *contentType);
```

Same as `AddFileAttachment`, but the content type can be explicitly specified.

Use this form when filename-based MIME type inference is unsuitable. `contentType` should be a MIME media type such as `application/octet-stream`.

Returns TRUE for success, FALSE for failure.

### Email.AddHeaderField

`Chilkat 11.7.0 · wc · Email · AddHeaderField · method`

```c
void CkEmailW_AddHeaderField(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *fieldValue);
```

Any standard or non-standard (custom) header field can be added to the email with this method. One interesting feature is that all header fields whose name begins with `CKX-` will not be included in the header when an email is sent. These fields will be included when saved to or loaded from XML. This makes it easy to include persistent meta-data with an email which your programs can use in any way it chooses.

**Important:** This method will replace an already-existing header field. To allow for adding duplicate header fields, call `AddHeaderField2` (see below).

This changes the MIME header stored in the current email object. It does not change the SMTP envelope, except where another component explicitly interprets a particular header.

### Email.AddHeaderField2

`Chilkat 11.7.0 · wc · Email · AddHeaderField2 · method`

```c
void CkEmailW_AddHeaderField2(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *fieldValue);
```

This method is the same as `AddHeaderField`, except that if the header field already exists, it is not replaced. A duplicate header will be added.

Use this method for headers that may legally occur more than once, such as `Received`. For a single-valued field that should be replaced, use `AddHeaderField`.

### Email.AddHtmlAlternativeBody

`Chilkat 11.7.0 · wc · Email · AddHtmlAlternativeBody · method`

```c
BOOL CkEmailW_AddHtmlAlternativeBody(HCkEmailW cHandle, const wchar_t *body);
```

Adds or replaces the HTML body representation of the email.

If no HTML alternative exists, one is added. If an HTML alternative already exists, it is replaced rather than duplicated. Repeated calls therefore leave at most one HTML alternative.

When paired with `AddPlainTextAlternativeBody`, Chilkat creates a `multipart/alternative` body so mail clients can choose the representation they support. Use `SetHtmlBody` when a multipart alternative is not needed.

Returns TRUE for success, FALSE for failure.

### Email.AddiCalendarAlternativeBody

`Chilkat 11.7.0 · wc · Email · AddiCalendarAlternativeBody · method`

```c
BOOL CkEmailW_AddiCalendarAlternativeBody(HCkEmailW cHandle, const wchar_t *icalContent, const wchar_t *methodName);
```

Adds or replaces an iCalendar body as a `text/calendar` alternative.

If an iCalendar alternative already exists, it is replaced rather than duplicated. Repeated calls therefore leave at most one calendar alternative.

`icalContent` contains the iCalendar data. `methodName` specifies the `method` parameter placed in the alternative body's `Content-Type` header, such as `REQUEST` or `CANCEL`.

```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:uid1@example.com
DTSTAMP:19970714T170000Z
ORGANIZER;CN=John Doe:MAILTO:john.doe@example.com
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
```

For example, when `methodName` is `REQUEST`, the MIME headers for the alternative body include:

```
Content-Type: text/calendar; method=REQUEST
Content-Transfer-Encoding: base64
```

Calendar-aware mail clients may display this part as a meeting invitation, cancellation, or published event according to the iCalendar `METHOD` value and the contents of `icalContent`.

Returns TRUE for success, FALSE for failure.

### Email.AddMultipleBcc

`Chilkat 11.7.0 · wc · Email · AddMultipleBcc · method`

```c
BOOL CkEmailW_AddMultipleBcc(HCkEmailW cHandle, const wchar_t *commaSeparatedAddresses);
```

Parses the mailbox list in `commaSeparatedAddresses` and appends the results to the blind carbon-copy (Bcc) recipient list.

Recipients may be separated by commas or semicolons. Each item may be a bare address or a mailbox with a display name. Quoted display names may contain commas.

Empty items are ignored. Duplicate addresses are retained.

**Note:** Before v11.0.0, BCC addresses were not added to the MIME header. Starting in v11.0.0, BCC addresses are included in the MIME header. Most email servers remove the `Bcc` header before delivering the message to regular recipients. To omit BCC addresses from generated MIME, place the `NoBccHeader` keyword in `UncommonOptions` before adding BCC recipients.

Returns TRUE for success, FALSE for failure.

See also:

- [Why BCC Email Addresses Should Never be in “BCC” MIME Headers](https://cknotes.com/bcc-email-addresses-should-never-be-in-bcc-mime-headers/)

### Email.AddMultipleCC

`Chilkat 11.7.0 · wc · Email · AddMultipleCC · method`

```c
BOOL CkEmailW_AddMultipleCC(HCkEmailW cHandle, const wchar_t *commaSeparatedAddresses);
```

Parses the mailbox list in `commaSeparatedAddresses` and appends the results to the carbon-copy (Cc) recipient list.

Recipients may be separated by commas or semicolons. Each item may be a bare address or a mailbox with a display name. Quoted display names may contain commas.

Empty items are ignored. Duplicate addresses are retained.

Returns TRUE for success, FALSE for failure.

### Email.AddMultipleTo

`Chilkat 11.7.0 · wc · Email · AddMultipleTo · method`

```c
BOOL CkEmailW_AddMultipleTo(HCkEmailW cHandle, const wchar_t *commaSeparatedAddresses);
```

Parses the mailbox list in `commaSeparatedAddresses` and appends the results to the direct-recipient (To) list.

Recipients may be separated by commas or semicolons. Each item may be a bare address or a mailbox with a display name. Quoted display names may contain commas.

Empty items are ignored. Duplicate addresses are retained.

Returns TRUE for success, FALSE for failure.

### Email.AddPfxSourceBd

`Chilkat 11.7.0 · wc · Email · AddPfxSourceBd · method · since 11.0.0`

```c
BOOL CkEmailW_AddPfxSourceBd(HCkEmailW cHandle, HCkBinDataW bd, const wchar_t *password);
```

Adds the PFX data in `bd` to the list of certificate and private-key sources used during decryption or signing. `password` contains the PFX password.

Call this method once for each additional PFX source.

The PFX data becomes a lookup source for subsequent cryptographic operations by this object. Adding it does not immediately decrypt or sign the message.

Returns TRUE for success, FALSE for failure.

### Email.AddPfxSourceFile

`Chilkat 11.7.0 · wc · Email · AddPfxSourceFile · method`

```c
BOOL CkEmailW_AddPfxSourceFile(HCkEmailW cHandle, const wchar_t *pfxFilePath, const wchar_t *pfxPassword);
```

Adds the PFX file specified by `pfxFilePath` to the internal list of certificate and private-key sources used during decryption. `pfxPassword` contains the PFX password.

Call this method once for each additional PFX file. On Windows, Chilkat automatically searches the system certificate stores. On macOS, Chilkat automatically searches the Keychain. Therefore, explicitly adding a PFX source is often unnecessary when the required certificate and private key are already installed.

The PFX file becomes a certificate source for later operations performed by this email object. The file must be readable when this method is called.

Returns TRUE for success, FALSE for failure.

### Email.AddPlainTextAlternativeBody

`Chilkat 11.7.0 · wc · Email · AddPlainTextAlternativeBody · method`

```c
BOOL CkEmailW_AddPlainTextAlternativeBody(HCkEmailW cHandle, const wchar_t *body);
```

Adds or replaces the plain-text body representation of the email.

If no plain-text alternative exists, one is added. If a plain-text alternative already exists, it is replaced rather than duplicated. Repeated calls therefore leave at most one plain-text alternative.

When paired with `AddHtmlAlternativeBody`, Chilkat creates a `multipart/alternative` body so text-only clients have a suitable representation. Use `SetTextBody` when a multipart alternative is not needed.

Returns TRUE for success, FALSE for failure.

### Email.AddRelatedBd

`Chilkat 11.7.0 · wc · Email · AddRelatedBd · method · since 9.5.0.65`

```c
BOOL CkEmailW_AddRelatedBd(HCkEmailW cHandle, const wchar_t *filename, HCkBinDataW binData, const wchar_t *outStr);
const wchar_t *CkEmailW_addRelatedBd(HCkEmailW cHandle, const wchar_t *filename, HCkBinDataW binData);
```

Adds a related item using the contents of a `BinData` object. Returns the `Content-ID` for the newly added related item.

The returned `Content-ID` can be used in the HTML body as `cid:returnedContentId`.

Returns TRUE for success, FALSE for failure.

See also:

- [Different Ways to Reference HTML Images in Email MIME](https://cknotes.com/different-ways-to-reference-html-images-in-email-mime/)

### Email.AddRelatedBd2

`Chilkat 11.7.0 · wc · Email · AddRelatedBd2 · method · since 9.5.0.65`

```c
BOOL CkEmailW_AddRelatedBd2(HCkEmailW cHandle, HCkBinDataW binData, const wchar_t *fileNameInHtml);
```

Adds a related item using the binary data in `binData`.

`fileNameInHtml` specifies the filename, path, or URL used by the corresponding HTML reference, such as an `img` element's `src` attribute.

This form is useful when the HTML already contains a filename, URL, or path reference that Chilkat should associate with the new related MIME part.

Returns TRUE for success, FALSE for failure.

See also:

- [Different Ways to Reference HTML Images in Email MIME](https://cknotes.com/different-ways-to-reference-html-images-in-email-mime/)

### Email.AddRelatedFile

`Chilkat 11.7.0 · wc · Email · AddRelatedFile · method`

```c
BOOL CkEmailW_AddRelatedFile(HCkEmailW cHandle, const wchar_t *path, const wchar_t *outStrContentID);
const wchar_t *CkEmailW_addRelatedFile(HCkEmailW cHandle, const wchar_t *path);
```

Adds the contents of the local file in `path` as a related MIME resource and returns the generated `Content-ID`.

The returned value is the bare `Content-ID`. It does not include angle brackets or the `cid:` prefix. For example, if the method returns `CID-123@example`, the HTML reference is `cid:CID-123@example`.

This method does not modify the HTML body. The application must add or update the corresponding `cid:` reference itself.

The file becomes a related MIME resource rather than an ordinary attachment.

Returns TRUE for success, FALSE for failure.

See also:

- [Different Ways to Reference HTML Images in Email MIME](https://cknotes.com/different-ways-to-reference-html-images-in-email-mime/)

### Email.AddRelatedFile2

`Chilkat 11.7.0 · wc · Email · AddRelatedFile2 · method`

```c
BOOL CkEmailW_AddRelatedFile2(HCkEmailW cHandle, const wchar_t *filenameOnDisk, const wchar_t *filenameInHtml);
```

Adds the local file in `filenameOnDisk` as a related MIME resource addressed by `Content-Location` rather than `Content-ID`.

`filenameInHtml` becomes the related item's MIME filename and `Content-Location` value. It should match the filename, path, or URL already used by the corresponding HTML reference, such as an `img` element's `src` attribute.

This method does not generate a `Content-ID` and does not modify the HTML body. The HTML must already refer to `filenameInHtml`.

**Note:** Outlook.com may fail to display embedded images when `filenameInHtml` contains a path. For best compatibility, use only a filename when targeting Outlook.com.

Returns TRUE for success, FALSE for failure.

See also:

- [Different Ways to Reference HTML Images in Email MIME](https://cknotes.com/different-ways-to-reference-html-images-in-email-mime/)

### Email.AddRelatedHeader

`Chilkat 11.7.0 · wc · Email · AddRelatedHeader · method`

```c
void CkEmailW_AddRelatedHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *fieldValue);
```

Adds or replaces a MIME header field in one of the email's related items. If the header field does not exist, it is added. Otherwise it is replaced.

**Indexing:** `index` is zero-based and must identify an existing related item. The change applies to the related item's MIME sub-header.

### Email.AddRelatedString

`Chilkat 11.7.0 · wc · Email · AddRelatedString · method`

```c
BOOL CkEmailW_AddRelatedString(HCkEmailW cHandle, const wchar_t *nameInHtml, const wchar_t *str, const wchar_t *charset, const wchar_t *outCid);
const wchar_t *CkEmailW_addRelatedString(HCkEmailW cHandle, const wchar_t *nameInHtml, const wchar_t *str, const wchar_t *charset);
```

Adds a text-based related MIME resource, such as a style sheet, and returns the generated `Content-ID`.

`nameInHtml` is the MIME filename or resource name, `str` contains the text content, and `charset` specifies the charset used to encode that content.

The returned value is the bare `Content-ID`. It does not include angle brackets or the `cid:` prefix. This method does not modify the HTML body; the application must add or update the corresponding `cid:` reference itself.

Returns TRUE for success, FALSE for failure.

### Email.AddRelatedString2

`Chilkat 11.7.0 · wc · Email · AddRelatedString2 · method`

```c
void CkEmailW_AddRelatedString2(HCkEmailW cHandle, const wchar_t *fileNameInHtml, const wchar_t *content, const wchar_t *charset);
```

Adds a related item to the email from an in-memory string. Related items are things such as images and style sheets that are embedded within an HTML email. They are not considered attachments because their sole purpose is to participate in the display of the HTML.

`fileNameInHtml` should be set to the filename used in an HTML `img` tag's `src` attribute, or to the URL referenced by an HTML `link` tag for a style sheet. `content` contains the Unicode text to add. `charset` specifies the charset to which `content` is converted before the MIME part is created, such as `iso-8859-1`, `utf-8`, or `Shift_JIS`.

The resource is added as related content, not as a normal file attachment.

### Email.AddStringAttachment

`Chilkat 11.7.0 · wc · Email · AddStringAttachment · method`

```c
BOOL CkEmailW_AddStringAttachment(HCkEmailW cHandle, const wchar_t *path, const wchar_t *content);
```

Adds an attachment directly from a string in memory to the email.

`path` supplies the filename placed in MIME, not a file to be read. `content` is the text content that becomes the attachment body.

Returns TRUE for success, FALSE for failure.

### Email.AddStringAttachment2

`Chilkat 11.7.0 · wc · Email · AddStringAttachment2 · method`

```c
BOOL CkEmailW_AddStringAttachment2(HCkEmailW cHandle, const wchar_t *path, const wchar_t *content, const wchar_t *charset);
```

Adds a text attachment using the in-memory string in `content`.

`path` specifies the attachment filename; it is not a path to an existing local file. `charset` specifies the charset used to encode the string before it is added to the email.

**Note:** `charset` may begin with `bom-` or `no-bom-` to require or suppress a byte-order mark for encodings such as UTF-8 or UTF-16. Examples include `bom-utf-8` and `no-bom-utf-8`.

This method is appropriate for text data already held in memory. For arbitrary binary bytes, use a `BinData`- or byte-based attachment method instead.

Returns TRUE for success, FALSE for failure.

### Email.AddTo

`Chilkat 11.7.0 · wc · Email · AddTo · method`

```c
BOOL CkEmailW_AddTo(HCkEmailW cHandle, const wchar_t *friendlyName, const wchar_t *emailAddress);
```

Adds a recipient to the `to` list. `emailAddress` is required, but `friendlyName` may be empty. Emails that have no `To` recipients will be sent to \<undisclosed-recipients>.

To add multiple recipients, call this method once per TO recipient.

The recipient is added to the current in-memory message. Use `NumTo` and the To getter methods to inspect the resulting list.

Returns TRUE for success, FALSE for failure.

### Email.AesDecrypt

`Chilkat 11.7.0 · wc · Email · AesDecrypt · method`

```c
BOOL CkEmailW_AesDecrypt(HCkEmailW cHandle, const wchar_t *password);
```

Decrypts and restores an email message that was previously encrypted using `AesEncrypt`. `password` must be the same password that was passed as `password` to `AesEncrypt`.

This is Chilkat's password-based email-object encryption counterpart to `AesEncrypt`; it is not S/MIME certificate-based decryption.

Returns TRUE for success, FALSE for failure.

### Email.AesEncrypt

`Chilkat 11.7.0 · wc · Email · AesEncrypt · method`

```c
BOOL CkEmailW_AesEncrypt(HCkEmailW cHandle, const wchar_t *password);
```

Encrypts the email body, all alternative bodies, all message sub-parts, and attachments using 128-bit AES CBC encryption. To decrypt the email, call `AesDecrypt` and pass the same value for `password`.

The `AesEncrypt`/`AesDecrypt` methods use symmetric password-based AES encryption and do not use certificates or private keys. The sending and receiving applications must both use Chilkat, and the value of `password` must be known by both applications.

This is separate from S/MIME encryption controlled by `SendEncrypted`.

Returns TRUE for success, FALSE for failure.

### Email.AppendToBody

`Chilkat 11.7.0 · wc · Email · AppendToBody · method`

```c
void CkEmailW_AppendToBody(HCkEmailW cHandle, const wchar_t *str);
```

Appends a string to the plain-text body.

If the message has only an HTML body, this method does not append HTML. Use `SetHtmlBody` or retrieve and reset the HTML body when HTML content must be extended.

### Email.ApplyFixups

`Chilkat 11.7.0 · wc · Email · ApplyFixups · method · since 9.5.0.71`

```c
BOOL CkEmailW_ApplyFixups(HCkEmailW cHandle, const wchar_t *fixups);
```

Repairs selected MIME-formatting problems commonly found in email produced by other software.

`fixups` is a comma-separated list of fixup keywords. The following keyword is currently defined:

- `FixRelated` — Relocates HTML-related items, such as embedded images, into the appropriate MIME structure so they are not incorrectly presented as ordinary attachments.

Fixups modify the current in-memory MIME structure. Apply them only when the input message exhibits the corresponding formatting problem.

Returns TRUE for success, FALSE for failure.

### Email.AspUnpack

`Chilkat 11.7.0 · wc · Email · AspUnpack · method`

```c
BOOL CkEmailW_AspUnpack(HCkEmailW cHandle, const wchar_t *prefix, const wchar_t *saveDir, const wchar_t *urlPath, BOOL cleanFiles);
```

Unpacks an HTML email's body and its related items (images, style sheets, and the like) to the filesystem: each related part is written as a separate file, and the HTML is rewritten so those parts load as ordinary files instead of `cid:` references.

**Despite the "Asp" in the name** (a historical artifact), this method is not limited to classic ASP. It is useful whenever an HTML email must be displayed or processed outside of a mail client, including:

- **Web display** — rendering a message in webmail or any web application (PHP, ASP.NET, Node, Java, Python, and so on), where the browser loads the saved images and style sheets from a URL.
- **Archiving** — saving an email as a self-contained, browsable HTML folder for long-term storage or compliance, viewable later without the original mail client.
- **Embedded viewers** — loading the unpacked HTML into a desktop application's built-in browser or WebView control, which renders local files.
- **Format conversion** — feeding the HTML to an HTML-to-PDF (or image) renderer that needs the related files present on disk.

The arguments control the output: `prefix` is prepended to each saved filename, `saveDir` is the filesystem directory where files are written, `urlPath` is the URL base substituted into the rewritten HTML, and `cleanFiles` removes previously unpacked files first when set to **true**.

For purely local viewing using relative paths rather than a web `urlPath`, see `UnpackHtml`. To instead produce a single self-contained MHT file that a WebBrowser control can display, see `CreateTempMht`.

Returns TRUE for success, FALSE for failure.

### Email.AttachEmail

`Chilkat 11.7.0 · wc · Email · AttachEmail · method · since 9.5.0.87`

```c
BOOL CkEmailW_AttachEmail(HCkEmailW cHandle, HCkEmailW email);
```

Attaches a copy of `email` to this email object. The attached email is encapsulated in a `message/rfc822` subpart.

A copy is attached, so later changes to `email` do not change the embedded message. The new part is counted by `NumAttachedMessages`.

Returns TRUE for success, FALSE for failure.

### Email.BEncodeString

`Chilkat 11.7.0 · wc · Email · BEncodeString · method`

```c
BOOL CkEmailW_BEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset, const wchar_t *outEncodedStr);
const wchar_t *CkEmailW_bEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset);
```

Converts the Unicode string in `str` to the charset specified by `charset`, B-encodes the resulting multibyte data, and returns the encoded string.

B-encoding is commonly used in RFC 2047 encoded words for non-ASCII MIME header text. `charset` controls the byte charset used before Base64 encoding.

Returns TRUE for success, FALSE for failure.

### Email.Clear

`Chilkat 11.7.0 · wc · Email · Clear · method · since 9.5.0.76`

```c
void CkEmailW_Clear(HCkEmailW cHandle);
```

Removes the current message content, including recipients, headers, body representations, attachments, related items, and embedded messages. It does not delete or alter a message on a mail server.

This method does not reset every configurable property. It resets message-oriented state such as `Charset`, `SendSigned`, `SendEncrypted`, `OverwriteExisting`, and `ReturnReceipt` to their defaults.

Other settings remain unchanged. In particular, replacement patterns and settings such as `SigningHashAlg`, `Pkcs7KeyLength`, `OaepMgfHash`, `PrependHeaders`, and `UncommonOptions` are preserved.

After clearing, the email has one default empty text body. When serialized, Chilkat can emit the standard headers for an empty email.

### Email.ClearBcc

`Chilkat 11.7.0 · wc · Email · ClearBcc · method`

```c
void CkEmailW_ClearBcc(HCkEmailW cHandle);
```

Clears the list of blind carbon-copy recipients.

This changes only the current email object and does not affect messages already sent.

### Email.ClearCC

`Chilkat 11.7.0 · wc · Email · ClearCC · method`

```c
void CkEmailW_ClearCC(HCkEmailW cHandle);
```

Clears the list of carbon-copy recipients.

This changes only the current email object and does not affect messages already sent.

### Email.ClearEncryptCerts

`Chilkat 11.7.0 · wc · Email · ClearEncryptCerts · method`

```c
void CkEmailW_ClearEncryptCerts(HCkEmailW cHandle);
```

Clears the internal list of explicitly specified certificates to be used for this encrypted email.

This removes certificates added explicitly for future encryption operations. It does not remove certificates from the Windows certificate stores, the macOS Keychain, or any PFX source.

### Email.ClearTo

`Chilkat 11.7.0 · wc · Email · ClearTo · method`

```c
void CkEmailW_ClearTo(HCkEmailW cHandle);
```

Clears the list of `to` recipients.

This changes only the current email object and does not affect messages already sent.

### Email.ComputeGlobalKey2

`Chilkat 11.7.0 · wc · Email · ComputeGlobalKey2 · method · since 9.5.0.59`

```c
BOOL CkEmailW_ComputeGlobalKey2(HCkEmailW cHandle, const wchar_t *encoding, BOOL bFold, const wchar_t *outStr);
const wchar_t *CkEmailW_computeGlobalKey2(HCkEmailW cHandle, const wchar_t *encoding, BOOL bFold);
```

Computes a global unique key for the email. The key is created by a digest-MD5 hash of the concatenation of the following:

```
messageID + CRLF + subject + CRLF + from + CRLF + date + CRLF + recipientAddrs

messageID contains the contents of the Message-ID header field.
subject contains the contents of the Subject header field, trimmed of whitespace from both ends,
 where TAB characters are converted to SPACE characters, and internal whitespace is trimmed so that
 no more than one SPACE char in a row exists.
from contains the lowercase From header email address.
date contains the contents of the Date header field.
toAddrs contains lowercase To and Cc recipient email addresses, comma-separated, with duplicates removed, and sorted
 in ascending order. The BCC addresses are NOT included.

(After calling this method, the LastErrorText property can be examined to see the string that was hashed.)
```

The 16-byte MD5 hash is returned as an encoded string. `encoding` determines the encoding: base64, hex, url, etc. If `bFold` is `TRUE`, then the 16-byte MD5 hash is folded to 8 bytes with an XOR to produce a shorter key.

The result is intended as a deterministic message key for indexing or duplicate detection. It is separate from the MIME `Message-ID` and does not modify the email.

Returns TRUE for success, FALSE for failure.

### Email.ConvertInlineImages

`Chilkat 11.7.0 · wc · Email · ConvertInlineImages · method · since 9.5.0.78`

```c
BOOL CkEmailW_ConvertInlineImages(HCkEmailW cHandle);
```

Converts images embedded inline within HTML to multipart/related MIME parts referenced from the HTML by CID.

This is useful for producing conventional HTML email where image data is stored in MIME parts rather than directly in the HTML. Review the resulting HTML and related-item collection after conversion.

Returns TRUE for success, FALSE for failure.

### Email.CreateTempMht

`Chilkat 11.7.0 · wc · Email · CreateTempMht · method`

```c
BOOL CkEmailW_CreateTempMht(HCkEmailW cHandle, const wchar_t *inFilename, const wchar_t *outPath);
const wchar_t *CkEmailW_createTempMht(HCkEmailW cHandle, const wchar_t *inFilename);
```

Prepares the email for display in a web browser and saves it as a temporary MHT (MIME HTML) file, returning the path to the file. If `inFilename` is empty, a temporary filename is generated automatically.

To make the message viewable as a standalone web page, this method transforms the email as follows:

- **All attachments are dropped.**
- If the email has **both HTML and plain-text alternatives**, the plain-text alternative is dropped.
- If the email has **only a plain-text body**, that body is converted to HTML.

The resulting MHT file can be loaded by a WebBrowser control (or any viewer that understands MHT) to render the message, inline images and all. To instead unpack the HTML and its related files to loose files served by a web application, see `AspUnpack`.

Returns TRUE for success, FALSE for failure.

### Email.DropAttachments

`Chilkat 11.7.0 · wc · Email · DropAttachments · method`

```c
void CkEmailW_DropAttachments(HCkEmailW cHandle);
```

Removes all attachments from the email.

This removes ordinary file attachments from the in-memory message. Related items and attached `message/rfc822` emails are separate and are not described by this method.

### Email.DropRelatedItem

`Chilkat 11.7.0 · wc · Email · DropRelatedItem · method`

```c
void CkEmailW_DropRelatedItem(HCkEmailW cHandle, int index);
```

A related item is typically an embedded image referenced from the HTML in the email via a `CID` hyperlink. This method removes the Nth embedded image from the email. Note: If the HTML tries to reference the removed image, it will be displayed as a broken image link.

This changes only the current in-memory `Email` object and does not delete or alter a message on a mail server.

### Email.DropRelatedItems

`Chilkat 11.7.0 · wc · Email · DropRelatedItems · method`

```c
void CkEmailW_DropRelatedItems(HCkEmailW cHandle);
```

A related item is typically an embedded image referenced from the HTML in the email via a `CID` hyperlink. This method removes all the embedded images from the email.

This removes related MIME resources from the in-memory message. It does not remove ordinary attachments.

### Email.DropSingleAttachment

`Chilkat 11.7.0 · wc · Email · DropSingleAttachment · method`

```c
BOOL CkEmailW_DropSingleAttachment(HCkEmailW cHandle, int index);
```

Removes the attachment at the zero-based index specified by `index`.

`index` is zero-based; valid values are from `0` through `NumAttachments - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GenerateFilename

`Chilkat 11.7.0 · wc · Email · GenerateFilename · method`

```c
BOOL CkEmailW_GenerateFilename(HCkEmailW cHandle, const wchar_t *outStrFilename);
const wchar_t *CkEmailW_generateFilename(HCkEmailW cHandle);
```

Generates a unique filename for this email. The filename will be different each time the method is called.

This method returns a filename only; it does not create a file. It is useful when saving many messages and a collision-resistant local name is needed.

Returns TRUE for success, FALSE for failure.

### Email.GetAlternativeBody

`Chilkat 11.7.0 · wc · Email · GetAlternativeBody · method`

```c
BOOL CkEmailW_GetAlternativeBody(HCkEmailW cHandle, int index, const wchar_t *outStrBody);
const wchar_t *CkEmailW_getAlternativeBody(HCkEmailW cHandle, int index);
```

Returns the Nth alternative body. The `NumAlternatives` property tells the number of alternative bodies present. Use the `GetHtmlBody` and `GetPlainTextBody` methods to easily get the HTML or plain text alternative bodies.

`index` is zero-based; valid values are from `0` through `NumAlternatives - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetAlternativeBodyBd

`Chilkat 11.7.0 · wc · Email · GetAlternativeBodyBd · method · since 9.5.0.67`

```c
BOOL CkEmailW_GetAlternativeBodyBd(HCkEmailW cHandle, int index, HCkBinDataW binData);
```

Returns the contents of the Nth alternative body to `binData`. The first alternative body is at index 0. This method should only be called when the `NumAlternatives` property has a value greater than 0.

`index` is zero-based; valid values are from `0` through `NumAlternatives - 1`. `binData` receives the body bytes.

Returns TRUE for success, FALSE for failure.

### Email.GetAlternativeBodyByContentType

`Chilkat 11.7.0 · wc · Email · GetAlternativeBodyByContentType · method`

```c
BOOL CkEmailW_GetAlternativeBodyByContentType(HCkEmailW cHandle, const wchar_t *contentType, const wchar_t *outStr);
const wchar_t *CkEmailW_getAlternativeBodyByContentType(HCkEmailW cHandle, const wchar_t *contentType);
```

Returns the alternative body by `Content-Type`, such as `text/plain`, `text/html`, `text/xml`, etc.

The lookup is useful when the alternative order is not known. Typical values for `contentType` are `text/plain` and `text/html`.

Returns TRUE for success, FALSE for failure.

### Email.GetAlternativeContentType

`Chilkat 11.7.0 · wc · Email · GetAlternativeContentType · method`

```c
BOOL CkEmailW_GetAlternativeContentType(HCkEmailW cHandle, int index, const wchar_t *outStrContentType);
const wchar_t *CkEmailW_getAlternativeContentType(HCkEmailW cHandle, int index);
```

Returns the content type of the Nth alternative body. The `NumAlternatives` property tells the number of alternative bodies present.

`index` is zero-based; valid values are from `0` through `NumAlternatives - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetAltHeaderField

`Chilkat 11.7.0 · wc · Email · GetAltHeaderField · method`

```c
BOOL CkEmailW_GetAltHeaderField(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *outStr);
const wchar_t *CkEmailW_getAltHeaderField(HCkEmailW cHandle, int index, const wchar_t *fieldName);
```

Returns the value of a header field within the Nth alternative body's MIME sub-part.

`index` is zero-based and refers to an alternative counted by `NumAlternatives`. `fieldName` names the MIME header field within that alternative part.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachedEmail

`Chilkat 11.7.0 · wc · Email · GetAttachedEmail · method · since 11.0.0`

```c
BOOL CkEmailW_GetAttachedEmail(HCkEmailW cHandle, int index, HCkEmailW email);
```

Copies the Nth embedded `message/rfc822` MIME part into `email`.

`index` is zero-based; valid values are from `0` through `NumAttachedMessages - 1`. `email` is replaced with an independent copy of the embedded message. Modifying `email` does not change the embedded message stored in the caller.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachedMessageAttr

`Chilkat 11.7.0 · wc · Email · GetAttachedMessageAttr · method · since 9.5.0.41`

```c
BOOL CkEmailW_GetAttachedMessageAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName, const wchar_t *outStr);
const wchar_t *CkEmailW_getAttachedMessageAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName);
```

Returns a header field attribute value for the Nth attached (embedded) email. For example, to get the value of the `name` attribute in the `Content-Type` header for the first attached message:

```
Content-Type: message/rfc822; name="md75000024149.eml"
```

then the method arguments should contain the values 0, `Content-Type`, `name`.

`index` is a zero-based attached-message index. `fieldName` names a MIME header field and `attrName` names one of that field's parameters.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachedMessageFilename

`Chilkat 11.7.0 · wc · Email · GetAttachedMessageFilename · method`

```c
BOOL CkEmailW_GetAttachedMessageFilename(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getAttachedMessageFilename(HCkEmailW cHandle, int index);
```

Returns the filename of the Nth attached (embedded) email. The filename is the `filename` attribute of the `Content-Disposition` header field found within the Nth message/rfc822 sub-part of the calling email object.

**Important:** The attached message filename is only present if the **`Content-Disposition`** header exists AND contains a `filename` attribute. If questions arise, one could open the email in a text editor to examine the MIME sub-header for the attached message (where the `Content-Type` = `message/rfc822`). For example, here is a sub-header that has a filename:

```
Content-Type: message/rfc822; name="GetAttachedMessageAttr.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="GetAttachedMessageAttr.eml"
```

Here is an attached message sub-header that does NOT have a filename:

```
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment
```

`index` is zero-based. The returned value comes from MIME metadata and should be sanitized before it is used as a local filesystem name.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentAttr

`Chilkat 11.7.0 · wc · Email · GetAttachmentAttr · method · since 9.5.0.41`

```c
BOOL CkEmailW_GetAttachmentAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName, const wchar_t *outStr);
const wchar_t *CkEmailW_getAttachmentAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName);
```

Returns a header field attribute value from the header field of the Nth attachment.

`index` is a zero-based attachment index. `fieldName` names a header field such as `Content-Type`, and `attrName` names one of that field's parameters, such as `charset` or `name`.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentBd

`Chilkat 11.7.0 · wc · Email · GetAttachmentBd · method · since 9.5.0.67`

```c
BOOL CkEmailW_GetAttachmentBd(HCkEmailW cHandle, int index, HCkBinDataW binData);
```

Copies an attachment's binary data into `binData`. The first attachment is at index 0.

`index` is zero-based. `binData` receives the attachment bytes.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentContentID

`Chilkat 11.7.0 · wc · Email · GetAttachmentContentID · method`

```c
BOOL CkEmailW_GetAttachmentContentID(HCkEmailW cHandle, int index, const wchar_t *outStrContentID);
const wchar_t *CkEmailW_getAttachmentContentID(HCkEmailW cHandle, int index);
```

Returns the ContentID header field for the Nth attachment. The first attachment is at index 0.

`index` is zero-based. The returned value is the identifier used by `cid:` references when the attachment is referenced inline.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentContentType

`Chilkat 11.7.0 · wc · Email · GetAttachmentContentType · method`

```c
BOOL CkEmailW_GetAttachmentContentType(HCkEmailW cHandle, int index, const wchar_t *outStrContentType);
const wchar_t *CkEmailW_getAttachmentContentType(HCkEmailW cHandle, int index);
```

Returns the `Content-Type` header field for the Nth attachment. Indexing of attachments begins at 0.

`index` is zero-based. The result is the MIME media type without implying that the filename extension is trustworthy.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentFilename

`Chilkat 11.7.0 · wc · Email · GetAttachmentFilename · method`

```c
BOOL CkEmailW_GetAttachmentFilename(HCkEmailW cHandle, int index, const wchar_t *outStrFilename);
const wchar_t *CkEmailW_getAttachmentFilename(HCkEmailW cHandle, int index);
```

Retrieves an attachment's filename.

`index` is zero-based. The returned value is the filename stored in MIME. It may contain path information or characters that are not valid in a local filesystem filename. When `SaveAllAttachments` or `SaveAttachedFile` saves the attachment, Chilkat ignores MIME path components and sanitizes the final filename as described by those methods.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentHeader

`Chilkat 11.7.0 · wc · Email · GetAttachmentHeader · method`

```c
BOOL CkEmailW_GetAttachmentHeader(HCkEmailW cHandle, int attachIndex, const wchar_t *fieldName, const wchar_t *outFieldValue);
const wchar_t *CkEmailW_getAttachmentHeader(HCkEmailW cHandle, int attachIndex, const wchar_t *fieldName);
```

Returns the value of a header field (by name) of an attachment.

`attachIndex` is a zero-based attachment index and `fieldName` is the MIME header-field name. Header-field names are case-insensitive.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentSize

`Chilkat 11.7.0 · wc · Email · GetAttachmentSize · method`

```c
int CkEmailW_GetAttachmentSize(HCkEmailW cHandle, int index);
```

Returns the size, in bytes, of the attachment at the zero-based index specified by `index`. Returns `-1` if `index` does not identify an existing attachment.

The returned value is the decoded attachment content size, not the number of Base64 characters in the MIME representation.

### Email.GetAttachmentString

`Chilkat 11.7.0 · wc · Email · GetAttachmentString · method`

```c
BOOL CkEmailW_GetAttachmentString(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStr);
const wchar_t *CkEmailW_getAttachmentString(HCkEmailW cHandle, int index, const wchar_t *charset);
```

Returns the attachment at the zero-based index specified by `index` as text.

`charset` specifies the charset used to interpret the attachment bytes, such as `utf-8`. CRLF sequences in the attachment are normalized to single newline characters in the returned string.

`index` is zero-based. `charset` controls conversion of the attachment bytes to Unicode; use a binary attachment getter when the content is not text.

Returns TRUE for success, FALSE for failure.

### Email.GetAttachmentStringCrLf

`Chilkat 11.7.0 · wc · Email · GetAttachmentStringCrLf · method`

```c
BOOL CkEmailW_GetAttachmentStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStrData);
const wchar_t *CkEmailW_getAttachmentStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset);
```

Retrieves an attachment's data as a String. All end-of-lines will be translated to CRLF sequences.

`index` is a zero-based attachment index. `charset` specifies the charset used to decode the attachment bytes to Unicode text.

Returns TRUE for success, FALSE for failure.

### Email.GetBcc

`Chilkat 11.7.0 · wc · Email · GetBcc · method`

```c
BOOL CkEmailW_GetBcc(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getBcc(HCkEmailW cHandle, int index);
```

Returns a blind carbon-copy recipient's full email address.

`index` is zero-based; valid values are from `0` through `NumBcc - 1`. The result may include both display name and address.

Returns TRUE for success, FALSE for failure.

### Email.GetBccAddr

`Chilkat 11.7.0 · wc · Email · GetBccAddr · method`

```c
BOOL CkEmailW_GetBccAddr(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getBccAddr(HCkEmailW cHandle, int index);
```

Returns the Nth BCC address (only the address part, not the friendly-name part).

`index` is zero-based; valid values are from `0` through `NumBcc - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetBccName

`Chilkat 11.7.0 · wc · Email · GetBccName · method`

```c
BOOL CkEmailW_GetBccName(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getBccName(HCkEmailW cHandle, int index);
```

Returns the Nth BCC name (only the friendly-name part, not the address part).

`index` is zero-based; valid values are from `0` through `NumBcc - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetCC

`Chilkat 11.7.0 · wc · Email · GetCC · method`

```c
BOOL CkEmailW_GetCC(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getCC(HCkEmailW cHandle, int index);
```

Returns a carbon-copy recipient's full email address.

`index` is zero-based; valid values are from `0` through `NumCC - 1`. The result may include both display name and address.

Returns TRUE for success, FALSE for failure.

### Email.GetCcAddr

`Chilkat 11.7.0 · wc · Email · GetCcAddr · method`

```c
BOOL CkEmailW_GetCcAddr(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getCcAddr(HCkEmailW cHandle, int index);
```

Returns the Nth CC address (only the address part, not the friendly-name part).

`index` is zero-based; valid values are from `0` through `NumCC - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetCcName

`Chilkat 11.7.0 · wc · Email · GetCcName · method`

```c
BOOL CkEmailW_GetCcName(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getCcName(HCkEmailW cHandle, int index);
```

Returns the Nth CC name (only the friendly-name part, not the address part).

`index` is zero-based; valid values are from `0` through `NumCC - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetDeliveryStatusInfo

`Chilkat 11.7.0 · wc · Email · GetDeliveryStatusInfo · method`

```c
BOOL CkEmailW_GetDeliveryStatusInfo(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *outFieldValue);
const wchar_t *CkEmailW_getDeliveryStatusInfo(HCkEmailW cHandle, const wchar_t *fieldName);
```

Returns a field from the `message/delivery-status` part of a delivery-status notification.

Call this method only for an email identified as a `multipart/report` delivery-status notification. `fieldName` specifies the field name, such as `Final-Recipient`, `Status`, `Action`, or `Reporting-MTA`.

```
Reporting-MTA: dns; XYZ.abc.nl

Final-Recipient: RFC822; someEmailAddr@doesnotexist123.nl
Action: failed
Status: 5.4.4
```

`fieldName` names a field in the delivery-status section. This method reads the report already present in the email object and performs no server query.

Returns TRUE for success, FALSE for failure.

### Email.GetDigestEmail

`Chilkat 11.7.0 · wc · Email · GetDigestEmail · method · since 11.0.0`

```c
BOOL CkEmailW_GetDigestEmail(HCkEmailW cHandle, int index, HCkEmailW email);
```

Returns in `email` the Nth digest email contained within a multipart/digest. The first digest is at index 0. Use the `NumDigests` property to get the number of digests available.

`index` is zero-based; valid values are from `0` through `NumDigests - 1`. `email` receives a copy of the digest message.

Returns TRUE for success, FALSE for failure.

### Email.GetDsnInfo

`Chilkat 11.7.0 · wc · Email · GetDsnInfo · method · since 11.0.0`

```c
BOOL CkEmailW_GetDsnInfo(HCkEmailW cHandle, HCkJsonObjectW json);
```

If the `IsMultipartReport` method indicates that the email is `multipart/report`, use this method to obtain the delivery-status information, including the final recipients, as JSON that is easy to parse.

The JSON is derived from report data already contained in the email; the method does not contact an SMTP server for updated status.

Returns TRUE for success, FALSE for failure.

### Email.GetHeaderField

`Chilkat 11.7.0 · wc · Email · GetHeaderField · method`

```c
BOOL CkEmailW_GetHeaderField(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *outStrFieldData);
const wchar_t *CkEmailW_getHeaderField(HCkEmailW cHandle, const wchar_t *fieldName);
```

Returns the value of a header field.

Header-field names are case-insensitive. If a field occurs more than once, use indexed header enumeration when each occurrence must be inspected separately.

Returns TRUE for success, FALSE for failure.

### Email.GetHeaderFieldName

`Chilkat 11.7.0 · wc · Email · GetHeaderFieldName · method`

```c
BOOL CkEmailW_GetHeaderFieldName(HCkEmailW cHandle, int index, const wchar_t *outStrFieldName);
const wchar_t *CkEmailW_getHeaderFieldName(HCkEmailW cHandle, int index);
```

Returns the name of the Nth header field. The `NumHeaderFields` property gives the number of header fields. Use `GetHeaderField` to retrieve a header field value by name.

The first header field is at index 0. (All Chilkat indexing is 0-based.)

`index` is zero-based; valid values are from `0` through `NumHeaderFields - 1`. Repeated fields appear as separate entries.

Returns TRUE for success, FALSE for failure.

### Email.GetHeaderFieldValue

`Chilkat 11.7.0 · wc · Email · GetHeaderFieldValue · method`

```c
BOOL CkEmailW_GetHeaderFieldValue(HCkEmailW cHandle, int index, const wchar_t *outStrFieldValue);
const wchar_t *CkEmailW_getHeaderFieldValue(HCkEmailW cHandle, int index);
```

Returns the value of the Nth header field. (Indexing begins at 0) The number of header fields can be obtained from the `NumHeaderFields` property.

The first header field is at index 0, the last header field is at index `NumHeaderFields`-1. (All Chilkat indexing is 0-based.)

`index` is zero-based; valid values are from `0` through `NumHeaderFields - 1`. Use the same index with `GetHeaderFieldName to identify the field.`

Returns TRUE for success, FALSE for failure.

### Email.GetHtmlBody

`Chilkat 11.7.0 · wc · Email · GetHtmlBody · method`

```c
BOOL CkEmailW_GetHtmlBody(HCkEmailW cHandle, const wchar_t *outStrBody);
const wchar_t *CkEmailW_getHtmlBody(HCkEmailW cHandle);
```

Returns the body having the `text/html` content type.

This reads the HTML representation already present in the email object. It does not automatically inline related images; use `GetHtmlBodySb` for that option.

Returns TRUE for success, FALSE for failure.

### Email.GetHtmlBodySb

`Chilkat 11.7.0 · wc · Email · GetHtmlBodySb · method · since 10.1.2`

```c
BOOL CkEmailW_GetHtmlBodySb(HCkEmailW cHandle, BOOL inlineImageData, HCkStringBuilderW sb);
```

Returns the body having the `text/html` content type. If `inlineImageData` is `TRUE`, the related images found in the MIME are inlined as base64 directly within the returned HTML. The HTML is returned in `sb`.

Inlining related images can substantially increase the size of the returned HTML because the image bytes are embedded as data URLs.

Returns TRUE for success, FALSE for failure.

### Email.GetImapUid

`Chilkat 11.7.0 · wc · Email · GetImapUid · method`

```c
unsigned long CkEmailW_GetImapUid(HCkEmailW cHandle);
```

When email headers are downloaded from an IMAP server (using Chilkat IMAP), a `ckx-imap-uid` header field is added. The content of this header is the UID or sequence number of the email on the IMAP server. In addition, a `ckx-imap-isUid` header field is added, and this will have the value YES or NO. If the value is YES, then `ckx-imap-uid` contains a UID, if the value is NO, then `ckx-imap-uid` contains the sequence number. This method returns the UID if `ckx-imap-uid` exists and contains a UID, otherwise it returns 0xFFFFFFFF.

An application that wishes to download the full email would use this UID and then call the Chilkat IMAP object's FetchSingle or FetchSingleAsMime methods.

**Note:** If an email was downloaded from the IMAP server in a way such that the UID is not received, then there will be no `ckx-imap-uid` header field and this method would return 0xFFFFFFFF. For example, if emails are downloaded by sequence numbers via the `Imap.FetchSequence` method, then UIDs are not used and therefore the email object will not contain this information.

This reads Chilkat metadata stored in the email object; it does not contact the IMAP server. The accompanying Boolean output distinguishes a stable UID from a mailbox sequence number.

### Email.GetMime

`Chilkat 11.7.0 · wc · Email · GetMime · method`

```c
BOOL CkEmailW_GetMime(HCkEmailW cHandle, const wchar_t *outStrMime);
const wchar_t *CkEmailW_getMime(HCkEmailW cHandle);
```

Returns the email as RFC822/MIME text containing the headers, body representations, related items, and attachments.

The result is suitable for saving as an `.eml` file or passing to an API that accepts MIME text.

Serialization may normalize header whitespace, `Content-Type` parameters, transfer encodings, and other MIME formatting. Therefore, MIME that is loaded and then reserialized is not guaranteed to be byte-for-byte identical to the original input. Repeated calls without modifying the email return the same current serialized form.

Headers that were explicitly removed, such as `Date`, `Message-ID`, or `MIME-Version`, are not necessarily regenerated by this method.

Returns TRUE for success, FALSE for failure.

### Email.GetMimeBd

`Chilkat 11.7.0 · wc · Email · GetMimeBd · method · since 9.5.0.62`

```c
BOOL CkEmailW_GetMimeBd(HCkEmailW cHandle, HCkBinDataW bindat);
```

Serializes the complete RFC822/MIME message and appends the bytes to `bindat`.

The output includes headers, body representations, related items, and attachments. Clear `bindat` first when replacement rather than append behavior is desired.

Serialization may normalize header whitespace, `Content-Type` parameters, transfer encodings, and other MIME formatting. Loading MIME and then calling this method is therefore not guaranteed to reproduce the original input byte-for-byte.

Returns TRUE for success, FALSE for failure.

### Email.GetMimeSb

`Chilkat 11.7.0 · wc · Email · GetMimeSb · method · since 9.5.0.62`

```c
BOOL CkEmailW_GetMimeSb(HCkEmailW cHandle, HCkStringBuilderW sb);
```

Returns the email as MIME text containing the email header, body (or bodies), related items (if any), and all attachments. The MIME is appended to the existing contents (if any) of `sb`.

Clear `sb` first when replacement rather than append behavior is desired.

Returns TRUE for success, FALSE for failure.

### Email.GetNthBinaryPartOfTypeBd

`Chilkat 11.7.0 · wc · Email · GetNthBinaryPartOfTypeBd · method · since 9.5.0.95`

```c
BOOL CkEmailW_GetNthBinaryPartOfTypeBd(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments, HCkBinDataW bd);
```

Loads `bd` with the binary bytes of the Nth MIME sub-part matching `contentType`, which can be an exact `Content-Type` such as `application/pdf`, or a wildcarded `Content-Type` such as `application/*`, or `*/*`. Indexing begins at 0. Call `GetNumPartsOfType` to find out how many MIME sub-parts exist for any given content type. If `inlineOnly` is `TRUE`, then only MIME sub-parts having a `Content-Disposition` of `inline` are included. If `excludeAttachments` is `TRUE`, then MIME sub-parts having a `Content-Disposition` of `attachment` are excluded.

**Note:** If the email was downloaded as header-only, it will not contain all the parts of the full email. Also, if downloaded from IMAP excluding attachments, those parts that are the attachments will (of course) be missing.

**Note:** Beginning in v9.5.0.95, `contentType` can be wildcarded. For example, it is possible to specify `text/*`, or simply `*` to match any `Content-Type`.

**Note:** Only non-multipart MIME parts are matched.

Use `GetNumPartsOfType` with the same filters to determine the valid zero-based index range before loading `bd`.

Returns TRUE for success, FALSE for failure.

### Email.GetNthContentType

`Chilkat 11.7.0 · wc · Email · GetNthContentType · method · since 9.5.0.95`

```c
BOOL CkEmailW_GetNthContentType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments, const wchar_t *outStr);
const wchar_t *CkEmailW_getNthContentType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments);
```

Returns the `Content-Type` of the Nth non-multipart MIME part matching the pattern in `contentType`. `index` is a zero-based index among the matching parts.

`contentType` may be an exact `Content-Type`, such as `text/plain`, or a wildcard pattern, such as `text/*` or `*`. When `inlineOnly` is `TRUE`, only parts having an `inline` `Content-Disposition` are considered. When `excludeAttachments` is `TRUE`, parts having an `attachment` `Content-Disposition` are excluded.

Use `GetNumPartsOfType` with the same filters to determine the valid zero-based index range.

Returns TRUE for success, FALSE for failure.

### Email.GetNthTextPartOfType

`Chilkat 11.7.0 · wc · Email · GetNthTextPartOfType · method · since 9.5.0.44`

```c
BOOL CkEmailW_GetNthTextPartOfType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments, const wchar_t *outStr);
const wchar_t *CkEmailW_getNthTextPartOfType(HCkEmailW cHandle, int index, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments);
```

Returns the text content of the Nth non-multipart MIME part matching the `Content-Type` pattern in `contentType`. `index` is a zero-based index among the matching parts.

`contentType` may be an exact `Content-Type`, such as `text/plain`, or a wildcard pattern, such as `text/*` or `*`. Use `GetNumPartsOfType` to determine the number of matching parts.

When `inlineOnly` is `TRUE`, only parts having an `inline` `Content-Disposition` are considered. When `excludeAttachments` is `TRUE`, parts having an `attachment` `Content-Disposition` are excluded.

**Note:** A header-only email, or an email downloaded from IMAP without attachments, does not contain every MIME part from the complete message.

Use `GetNumPartsOfType` with the same filters to determine the valid zero-based index range before retrieving a part.

Returns TRUE for success, FALSE for failure.

### Email.GetNumPartsOfType

`Chilkat 11.7.0 · wc · Email · GetNumPartsOfType · method · since 9.5.0.44`

```c
int CkEmailW_GetNumPartsOfType(HCkEmailW cHandle, const wchar_t *contentType, BOOL inlineOnly, BOOL excludeAttachments);
```

Returns the number of non-multipart MIME parts matching the `Content-Type` pattern in `contentType`.

`contentType` may be an exact `Content-Type`, such as `text/plain`, or a wildcard pattern, such as `text/*` or `*`. When `inlineOnly` is `TRUE`, only parts having an `inline` `Content-Disposition` are counted. When `excludeAttachments` is `TRUE`, parts having an `attachment` `Content-Disposition` are excluded.

**Note:** A header-only email, or an email downloaded from IMAP without attachments, does not contain every MIME part from the complete message.

The count is based on the MIME parts currently loaded in the email object. No attachment or body data is fetched from a server by this method.

### Email.GetPlainTextBody

`Chilkat 11.7.0 · wc · Email · GetPlainTextBody · method`

```c
BOOL CkEmailW_GetPlainTextBody(HCkEmailW cHandle, const wchar_t *outStrBody);
const wchar_t *CkEmailW_getPlainTextBody(HCkEmailW cHandle);
```

Returns the email body having the `text/plain` content type.

This reads the plain-text representation already present in the email object. It does not convert the HTML body to plain text.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedAttr

`Chilkat 11.7.0 · wc · Email · GetRelatedAttr · method · since 9.5.0.41`

```c
BOOL CkEmailW_GetRelatedAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName, const wchar_t *outStr);
const wchar_t *CkEmailW_getRelatedAttr(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *attrName);
```

Returns a header field attribute value from the header field of the Nth related item.

`index` is a zero-based related-item index. `fieldName` names a MIME header field and `attrName` names one of that field's parameters.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedContentID

`Chilkat 11.7.0 · wc · Email · GetRelatedContentID · method`

```c
BOOL CkEmailW_GetRelatedContentID(HCkEmailW cHandle, int index, const wchar_t *outStrContentID);
const wchar_t *CkEmailW_getRelatedContentID(HCkEmailW cHandle, int index);
```

Returns the content ID of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.

`index` is zero-based; valid values are from `0` through `NumRelatedItems - 1`. The value is normally referenced from HTML as a `cid:` URL.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedContentLocation

`Chilkat 11.7.0 · wc · Email · GetRelatedContentLocation · method`

```c
BOOL CkEmailW_GetRelatedContentLocation(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getRelatedContentLocation(HCkEmailW cHandle, int index);
```

Returns the `Content-Location` of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.

`index` is zero-based. `Content-Location` is an alternative to `Content-ID` for identifying a resource referenced by the HTML body.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedContentType

`Chilkat 11.7.0 · wc · Email · GetRelatedContentType · method`

```c
BOOL CkEmailW_GetRelatedContentType(HCkEmailW cHandle, int index, const wchar_t *outStrContentType);
const wchar_t *CkEmailW_getRelatedContentType(HCkEmailW cHandle, int index);
```

Returns the `Content-Type` of the Nth related content item in an email message.

`index` is zero-based; valid values are from `0` through `NumRelatedItems - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedFilename

`Chilkat 11.7.0 · wc · Email · GetRelatedFilename · method`

```c
BOOL CkEmailW_GetRelatedFilename(HCkEmailW cHandle, int index, const wchar_t *outStrFilename);
const wchar_t *CkEmailW_getRelatedFilename(HCkEmailW cHandle, int index);
```

Returns the filename of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.

`index` is zero-based. The returned MIME filename should be sanitized before it is used as a local filesystem path.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedHeader

`Chilkat 11.7.0 · wc · Email · GetRelatedHeader · method · since 10.0.0`

```c
BOOL CkEmailW_GetRelatedHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName, const wchar_t *outStr);
const wchar_t *CkEmailW_getRelatedHeader(HCkEmailW cHandle, int index, const wchar_t *fieldName);
```

Returns the value of a header field (by name) of a related item.

`index` is a zero-based related-item index. MIME header-field names are case-insensitive.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedString

`Chilkat 11.7.0 · wc · Email · GetRelatedString · method`

```c
BOOL CkEmailW_GetRelatedString(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStrData);
const wchar_t *CkEmailW_getRelatedString(HCkEmailW cHandle, int index, const wchar_t *charset);
```

Returns the text with CR line-endings of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.

`index` is zero-based and `charset` specifies the charset used to decode the related-item bytes to Unicode text.

Returns TRUE for success, FALSE for failure.

### Email.GetRelatedStringCrLf

`Chilkat 11.7.0 · wc · Email · GetRelatedStringCrLf · method`

```c
BOOL CkEmailW_GetRelatedStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset, const wchar_t *outStr);
const wchar_t *CkEmailW_getRelatedStringCrLf(HCkEmailW cHandle, int index, const wchar_t *charset);
```

Returns the text with CRLF line-endings of a related item contained with the email. Related items are typically images and style-sheets embedded within HTML emails.

`index` is zero-based and `charset` specifies the charset used to decode the related-item bytes to Unicode text.

Returns TRUE for success, FALSE for failure.

### Email.GetReplacePattern

`Chilkat 11.7.0 · wc · Email · GetReplacePattern · method`

```c
BOOL CkEmailW_GetReplacePattern(HCkEmailW cHandle, int index, const wchar_t *outStrPattern);
const wchar_t *CkEmailW_getReplacePattern(HCkEmailW cHandle, int index);
```

Returns a replacement pattern previously defined for mail-merge operations.

`index` is zero-based; valid values are from `0` through `NumReplacePatterns - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetReplaceString

`Chilkat 11.7.0 · wc · Email · GetReplaceString · method`

```c
BOOL CkEmailW_GetReplaceString(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getReplaceString(HCkEmailW cHandle, int index);
```

Returns a replacement string for a previously defined pattern/replacement string pair. (This is a mail-merge feature.)

**Note:** This method was found to not be working correctly and is fixed in Chilkat v9.5.0.91.

`index` is a zero-based pattern index. Use `NumReplacePatterns` to determine the valid range.

Returns TRUE for success, FALSE for failure.

### Email.GetReplaceString2

`Chilkat 11.7.0 · wc · Email · GetReplaceString2 · method`

```c
BOOL CkEmailW_GetReplaceString2(HCkEmailW cHandle, const wchar_t *pattern, const wchar_t *outStr);
const wchar_t *CkEmailW_getReplaceString2(HCkEmailW cHandle, const wchar_t *pattern);
```

Returns a replacement string for a previously defined pattern/replacement string pair. (This is a mail-merge feature.)

`pattern` is the previously registered pattern text, not a numeric index.

Returns TRUE for success, FALSE for failure.

### Email.GetReport

`Chilkat 11.7.0 · wc · Email · GetReport · method`

```c
BOOL CkEmailW_GetReport(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getReport(HCkEmailW cHandle, int index);
```

(See the `NumReports` property.) Returns the body content of the Nth report within a multipart/report email.

Multipart/report is a message type that contains data formatted for a mail server to read. It is split between a text/plain (or some other content/type easily readable) and a message/delivery-status, which contains the data formatted for the mail server to read.

It is defined in RFC 3462

`index` is zero-based; valid values are from `0` through `NumReports - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetTo

`Chilkat 11.7.0 · wc · Email · GetTo · method`

```c
BOOL CkEmailW_GetTo(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getTo(HCkEmailW cHandle, int index);
```

Returns a `to` recipient's full email address.

`index` is zero-based; valid values are from `0` through `NumTo - 1`. The result may include both display name and address.

Returns TRUE for success, FALSE for failure.

### Email.GetToAddr

`Chilkat 11.7.0 · wc · Email · GetToAddr · method`

```c
BOOL CkEmailW_GetToAddr(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getToAddr(HCkEmailW cHandle, int index);
```

Returns the Nth To address (only the address part, not the friendly-name part).

`index` is zero-based; valid values are from `0` through `NumTo - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetToName

`Chilkat 11.7.0 · wc · Email · GetToName · method`

```c
BOOL CkEmailW_GetToName(HCkEmailW cHandle, int index, const wchar_t *outStr);
const wchar_t *CkEmailW_getToName(HCkEmailW cHandle, int index);
```

Returns the Nth To name (only the friendly-name part, not the address part).

`index` is zero-based; valid values are from `0` through `NumTo - 1`.

Returns TRUE for success, FALSE for failure.

### Email.GetXml

`Chilkat 11.7.0 · wc · Email · GetXml · method`

```c
BOOL CkEmailW_GetXml(HCkEmailW cHandle, const wchar_t *outStrXml);
const wchar_t *CkEmailW_getXml(HCkEmailW cHandle);
```

Convert the email object to an XML document in memory

The XML is Chilkat's email-object representation, not MIME and not a standardized interchange format. Use `GetMime` when an RFC822/MIME message is required.

Returns TRUE for success, FALSE for failure.

### Email.HasHeaderMatching

`Chilkat 11.7.0 · wc · Email · HasHeaderMatching · method`

```c
BOOL CkEmailW_HasHeaderMatching(HCkEmailW cHandle, const wchar_t *fieldName, const wchar_t *valuePattern, BOOL caseSensitive);
```

Returns `TRUE` when the email contains a header field named `fieldName` whose value matches the wildcard pattern in `valuePattern`.

`valuePattern` may contain any number of `*` characters, where each asterisk matches zero or more characters. `caseSensitive` controls whether matching is case-sensitive.

The pattern syntax is a simple wildcard match, not a regular expression. Header-field names are compared without regard to case.

### Email.HasHtmlBody

`Chilkat 11.7.0 · wc · Email · HasHtmlBody · method`

```c
BOOL CkEmailW_HasHtmlBody(HCkEmailW cHandle);
```

Returns `TRUE` if the email has an HTML body.

Returns `TRUE` only when a `text/html` body is present in the current email object.

### Email.HasPlainTextBody

`Chilkat 11.7.0 · wc · Email · HasPlainTextBody · method`

```c
BOOL CkEmailW_HasPlainTextBody(HCkEmailW cHandle);
```

Returns `TRUE` if the email has a plain-text body.

Returns `TRUE` only when a `text/plain` body is present in the current email object.

### Email.IsMultipartReport

`Chilkat 11.7.0 · wc · Email · IsMultipartReport · method`

```c
BOOL CkEmailW_IsMultipartReport(HCkEmailW cHandle);
```

Returns `TRUE` if the email is a multipart/report email.

Returns `TRUE` when the top-level message structure is a `multipart/report`. Use `GetDsnInfo` or `GetReport` to examine report content.

### Email.LastDecryptCert

`Chilkat 11.7.0 · wc · Email · LastDecryptCert · method · since 11.0.0`

```c
BOOL CkEmailW_LastDecryptCert(HCkEmailW cHandle, HCkCertW cert);
```

Returns in `cert` the certificate used to decrypt this email.

Call this after a successful decryption to inspect the certificate associated with the private key that decrypted the message.

Returns TRUE for success, FALSE for failure.

### Email.LastSignerCert

`Chilkat 11.7.0 · wc · Email · LastSignerCert · method · since 11.0.0`

```c
BOOL CkEmailW_LastSignerCert(HCkEmailW cHandle, int index, HCkCertW cert);
```

Copies the certificate for the signer at the zero-based index specified by `index` into `cert`.

Most signed emails have one signer, but an email may contain multiple signatures.

Call this after parsing or verifying a signed message. `cert` receives a copy of the signer certificate and can be examined independently.

Returns TRUE for success, FALSE for failure.

### Email.LinkedDomains

`Chilkat 11.7.0 · wc · Email · LinkedDomains · method · since 11.0.0`

```c
BOOL CkEmailW_LinkedDomains(HCkEmailW cHandle, HCkStringTableW domains);
```

Extracts domain names from hyperlinks in an HTML email. Lowercase domains are appended to `domains` without creating duplicates.

This method parses links only; it does not perform DNS lookups or make network requests to the extracted domains.

Returns TRUE for success, FALSE for failure.

### Email.LoadEml

`Chilkat 11.7.0 · wc · Email · LoadEml · method`

```c
BOOL CkEmailW_LoadEml(HCkEmailW cHandle, const wchar_t *mimePath);
```

Loads a complete email from an `.eml` file. An EML file contains RFC822/MIME message text.

On success, the loaded message replaces the entire current email, including recipients, headers, bodies, related items, and attachments. If the file cannot be opened or parsed and the method fails, the email content that existed before the call is preserved.

The file is parsed locally; this method does not connect to an SMTP, POP3, or IMAP server.

Returns TRUE for success, FALSE for failure.

### Email.LoadTaskResult

`Chilkat 11.7.0 · wc · Email · LoadTaskResult · method · since 9.5.0.52`

```c
BOOL CkEmailW_LoadTaskResult(HCkEmailW cHandle, HCkTaskW task);
```

Loads the email object from a completed asynchronous task.

`task` must be a completed task produced by a compatible asynchronous email operation. Loading the result replaces the current email content.

Returns TRUE for success, FALSE for failure.

### Email.LoadXml

`Chilkat 11.7.0 · wc · Email · LoadXml · method`

```c
BOOL CkEmailW_LoadXml(HCkEmailW cHandle, const wchar_t *xmlPath);
```

Loads an email from a Chilkat XML email file.

On success, the loaded message replaces the entire current email, including recipients, headers, bodies, related items, and attachments. If the file cannot be opened or parsed and the method fails, the email content that existed before the call is preserved.

The file must contain XML previously produced by Chilkat email serialization. It is not an arbitrary XML-to-email conversion method.

Returns TRUE for success, FALSE for failure.

### Email.LoadXmlString

`Chilkat 11.7.0 · wc · Email · LoadXmlString · method`

```c
BOOL CkEmailW_LoadXmlString(HCkEmailW cHandle, const wchar_t *xmlStr);
```

Loads an email from the Chilkat XML representation in `xmlStr`, typically obtained from `GetXml`.

On success, the loaded message replaces the entire current email, including recipients, headers, bodies, related items, and attachments. If `xmlStr` cannot be parsed and the method fails, the email content that existed before the call is preserved.

This is a local parsing operation and does not connect to a mail server.

Returns TRUE for success, FALSE for failure.

### Email.MakeCopy

`Chilkat 11.7.0 · wc · Email · MakeCopy · method · since 11.0.0`

```c
BOOL CkEmailW_MakeCopy(HCkEmailW cHandle, HCkEmailW destEmail);
```

Copies the entire state of this email into `destEmail`, including all message content, recipients, headers, body representations, attachments, related items, embedded messages, replacement patterns, certificates, certificate sources, and configuration properties.

`destEmail` becomes an independent copy. Subsequent changes to either email object do not affect the other.

Returns TRUE for success, FALSE for failure.

### Email.QEncodeString

`Chilkat 11.7.0 · wc · Email · QEncodeString · method`

```c
BOOL CkEmailW_QEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset, const wchar_t *outEncodedStr);
const wchar_t *CkEmailW_qEncodeString(HCkEmailW cHandle, const wchar_t *str, const wchar_t *charset);
```

Converts the Unicode string in `str` to the charset specified by `charset`, Q-encodes the resulting multibyte data, and returns the encoded string.

Q-encoding is commonly used in RFC 2047 encoded words for non-ASCII MIME header text. `charset` controls the byte charset used before Q-encoding.

Returns TRUE for success, FALSE for failure.

### Email.RemoveAttachedMessage

`Chilkat 11.7.0 · wc · Email · RemoveAttachedMessage · method`

```c
void CkEmailW_RemoveAttachedMessage(HCkEmailW cHandle, int idx);
```

Removes the Nth message/rfc822 sub-part of the email. Indexing begins at 0.

`idx` is zero-based; valid values are from `0` through `NumAttachedMessages - 1`. This changes only the in-memory email.

### Email.RemoveAttachedMessages

`Chilkat 11.7.0 · wc · Email · RemoveAttachedMessages · method`

```c
void CkEmailW_RemoveAttachedMessages(HCkEmailW cHandle);
```

Removes all message/rfc822 sub-parts of the email object.

This does not remove ordinary file attachments or related HTML resources.

### Email.RemoveAttachmentPaths

`Chilkat 11.7.0 · wc · Email · RemoveAttachmentPaths · method`

```c
void CkEmailW_RemoveAttachmentPaths(HCkEmailW cHandle);
```

Removes relative or absolute path information from attachment filenames stored in the MIME, leaving only each final filename component.

This changes the MIME filename metadata only. It does not affect the behavior of `SaveAllAttachments` or `SaveAttachedFile`, because those methods already ignore path information in MIME attachment filenames and save beneath the directory specified by the application.

### Email.RemoveHeaderField

`Chilkat 11.7.0 · wc · Email · RemoveHeaderField · method`

```c
void CkEmailW_RemoveHeaderField(HCkEmailW cHandle, const wchar_t *fieldName);
```

Removes by name all occurrences of a header field.

Header-field names are case-insensitive. All repeated occurrences having the specified name are removed from the current email object.

### Email.RemoveHtmlAlternative

`Chilkat 11.7.0 · wc · Email · RemoveHtmlAlternative · method`

```c
void CkEmailW_RemoveHtmlAlternative(HCkEmailW cHandle);
```

Removes the HTML body from the email (if an HTML body exists).

Other body representations, attachments, and related items remain unchanged.

### Email.RemovePlainTextAlternative

`Chilkat 11.7.0 · wc · Email · RemovePlainTextAlternative · method`

```c
void CkEmailW_RemovePlainTextAlternative(HCkEmailW cHandle);
```

Removes the plain-text body from the email (if a plain-text body exists).

Other body representations, attachments, and related items remain unchanged.

### Email.SaveAllAttachments

`Chilkat 11.7.0 · wc · Email · SaveAllAttachments · method`

```c
BOOL CkEmailW_SaveAllAttachments(HCkEmailW cHandle, const wchar_t *dirPath);
```

Saves all attachments to the directory specified by `dirPath`. If `dirPath` or any of its directory components do not exist, Chilkat creates them automatically. The `OverwriteExisting` property controls whether existing files may be overwritten.

Chilkat first uses the filename from the MIME `Content-Disposition` header. If no filename is present there, it uses the `name` parameter from the `Content-Type` header. If neither is present, the attachment is saved as `attachedFile.txt`.

If the selected MIME filename contains relative or absolute path information, Chilkat ignores the path and uses only the final filename component. The file is always written beneath the application-specified directory in `dirPath`.

On Windows, Chilkat converts the final MIME filename component to a valid Windows filename. It replaces `|` and a `:` that is not part of a drive specification with `_`; removes `<`, `>`, `*`, `?`, and `"`; and interprets `/` and `\` as path separators, so the path is omitted. If the colon belongs to a drive specification such as `C:\`, it is discarded with the path. For example, `a<b>c:d|e?f*g.txt` is saved as `abc_d_efg.txt`.

Attachment filenames can be changed before saving. The number of attachments is available in the `NumAttachments` property. An application can call `GetAttachmentFilename` for each zero-based index and change a filename by calling `SetAttachmentFilename`.

Only attachments already present in the email object are saved. A message downloaded without attachment bodies must first have those bodies fetched by the mail protocol component.

Returns TRUE for success, FALSE for failure.

### Email.SaveAttachedFile

`Chilkat 11.7.0 · wc · Email · SaveAttachedFile · method`

```c
BOOL CkEmailW_SaveAttachedFile(HCkEmailW cHandle, int index, const wchar_t *dirPath);
```

Saves the attachment at the zero-based index specified by `index` to the directory specified by `dirPath`. If `dirPath` or any of its directory components do not exist, Chilkat creates them automatically. The `OverwriteExisting` property controls whether an existing file may be overwritten.

Chilkat first uses the filename from the MIME `Content-Disposition` header. If no filename is present there, it uses the `name` parameter from the `Content-Type` header. If neither is present, the attachment is saved as `attachedFile.txt`.

If the selected MIME filename contains relative or absolute path information, Chilkat ignores the path and uses only the final filename component. The file is always written beneath the application-specified directory in `dirPath`.

On Windows, Chilkat converts the final MIME filename component to a valid Windows filename. It replaces `|` and a `:` that is not part of a drive specification with `_`; removes `<`, `>`, `*`, `?`, and `"`; and interprets `/` and `\` as path separators, so the path is omitted. If the colon belongs to a drive specification such as `C:\`, it is discarded with the path. For example, `a<b>c:d|e?f*g.txt` is saved as `abc_d_efg.txt`.

The attachment data must already be present in the current `Email` object. This method does not retrieve missing attachment data from a mail server.

Returns TRUE for success, FALSE for failure.

### Email.SaveEml

`Chilkat 11.7.0 · wc · Email · SaveEml · method`

```c
BOOL CkEmailW_SaveEml(HCkEmailW cHandle, const wchar_t *emlFilePath);
```

Convert this email object to EML and save it to a file.

An EML file contains the complete RFC822/MIME message, including headers, bodies, related items, and attachments.

Returns TRUE for success, FALSE for failure.

### Email.SaveRelatedItem

`Chilkat 11.7.0 · wc · Email · SaveRelatedItem · method`

```c
BOOL CkEmailW_SaveRelatedItem(HCkEmailW cHandle, int index, const wchar_t *dirPath);
```

Saves the related item at the zero-based index specified by `index` to the directory specified by `dirPath`. If `dirPath` or any of its directory components do not exist, Chilkat creates them automatically. Valid indexes are from `0` through `NumRelatedItems - 1`. The `OverwriteExisting property controls whether an existing file may be overwritten.`

If the related item's MIME filename contains relative or absolute path information, Chilkat ignores the path and uses only the final filename component. The file is always written beneath the application-specified directory in `dirPath`.

Related items are typically images, style sheets, or other resources used by an HTML body. The related-item data must already be present in the email object.

Returns TRUE for success, FALSE for failure.

### Email.SaveXml

`Chilkat 11.7.0 · wc · Email · SaveXml · method`

```c
BOOL CkEmailW_SaveXml(HCkEmailW cHandle, const wchar_t *path);
```

Convert this email object to XML and save it to a file.

The generated XML is Chilkat's email-object serialization and can later be loaded with `LoadXml`. Use `SaveEml` for a standard MIME message file.

Returns TRUE for success, FALSE for failure.

### Email.SetAttachmentCharset

`Chilkat 11.7.0 · wc · Email · SetAttachmentCharset · method`

```c
BOOL CkEmailW_SetAttachmentCharset(HCkEmailW cHandle, int index, const wchar_t *charset);
```

Sets the `charset` parameter of the `Content-Type` header field for the attachment at the zero-based index specified by `index`. `charset` specifies the charset, such as `Shift_JIS`, `iso-8859-2`, `big5`, or `iso-8859-5`.

This updates MIME metadata and does not transcode the attachment bytes. Use it only when the bytes are already encoded in the charset specified by `charset`.

Returns TRUE for success, FALSE for failure.

### Email.SetAttachmentDisposition

`Chilkat 11.7.0 · wc · Email · SetAttachmentDisposition · method`

```c
BOOL CkEmailW_SetAttachmentDisposition(HCkEmailW cHandle, int index, const wchar_t *disposition);
```

Sets the `Content-Disposition` value for the attachment at the zero-based index specified by `index`.

The default disposition is `attachment`. Set `disposition` to `inline` when the attachment should be presented as inline content.

`index` is zero-based. `inline` suggests that a mail client may display the part in the message, while `attachment` suggests a separate downloadable file.

Returns TRUE for success, FALSE for failure.

### Email.SetAttachmentFilename

`Chilkat 11.7.0 · wc · Email · SetAttachmentFilename · method`

```c
BOOL CkEmailW_SetAttachmentFilename(HCkEmailW cHandle, int index, const wchar_t *filename);
```

Changes the filename of the attachment at the zero-based index specified by `index`. `filename` contains the new filename.

`index` is zero-based. This changes the filename stored in MIME and does not rename any original local file.

Returns TRUE for success, FALSE for failure.

### Email.SetBodyBd

`Chilkat 11.7.0 · wc · Email · SetBodyBd · method · since 11.0.0`

```c
BOOL CkEmailW_SetBodyBd(HCkEmailW cHandle, HCkBinDataW bd, const wchar_t *contentType, const wchar_t *disposition, const wchar_t *filename);
```

Sets the main email body from the binary data in `bd`.

`contentType` specifies the MIME `Content-Type`. `disposition` specifies the disposition and may be empty, `inline`, or `attachment`. `filename` optionally specifies a filename. When `filename` is provided, `disposition` must also be specified because the filename is an attribute of the `Content-Disposition` header.

This replaces the main body using bytes already stored in `bd`. It does not add a separate attachment unless `disposition` and `filename` intentionally describe the body as one.

Returns TRUE for success, FALSE for failure.

### Email.SetDecryptCert

`Chilkat 11.7.0 · wc · Email · SetDecryptCert · method · since 9.5.0.57`

```c
BOOL CkEmailW_SetDecryptCert(HCkEmailW cHandle, HCkCertW cert);
```

Allows for a certificate to be explicitly provided for decryption. When an email object is loaded via any method, such as `LoadEml`, `SetFromMimeText`, `SetFromMimeBytes`, etc., security layers (signatures and encryption) are automatically unwrapped. This method could be called prior to calling a method that loads the email.

Configure the certificate before loading or unwrapping the encrypted MIME so the private key is available at decryption time.

Returns TRUE for success, FALSE for failure.

### Email.SetDecryptCert2

`Chilkat 11.7.0 · wc · Email · SetDecryptCert2 · method · since 9.5.0.57`

```c
BOOL CkEmailW_SetDecryptCert2(HCkEmailW cHandle, HCkCertW cert, HCkPrivateKeyW key);
```

Explicitly provides the certificate in `cert` and the corresponding private key in `key` for decryption. When an email object is loaded by a method such as `LoadEml`, `SetFromMimeText`, or `SetFromMimeBytes`, security layers such as signatures and encryption are automatically unwrapped. Decryption requires the private key in `key`.

On Windows, Chilkat automatically searches the system certificate stores for the required certificate and private key. On macOS, Chilkat automatically searches the Keychain. When the required certificate and private key are not installed in one of these locations, provide them in `cert` and `key`, or call `AddPfxSourceFile` or `AddPfxSourceData`.

Call this method before loading or unwrapping the encrypted MIME. `cert` and `key` must correspond to one another.

Returns TRUE for success, FALSE for failure.

See also:

- [Multipart/signed Email Handling](http://www.cknotes.com/?p=174)

### Email.SetDt

`Chilkat 11.7.0 · wc · Email · SetDt · method`

```c
BOOL CkEmailW_SetDt(HCkEmailW cHandle, HCkDateTimeW dt);
```

Sets the `Date` header field of the email to have the value of the date/time object provided.

The date/time is formatted as an RFC822 `Date` header when the message is serialized.

Returns TRUE for success, FALSE for failure.

### Email.SetEdifactBody

`Chilkat 11.7.0 · wc · Email · SetEdifactBody · method · since 9.5.0.28`

```c
void CkEmailW_SetEdifactBody(HCkEmailW cHandle, const wchar_t *message, const wchar_t *name, const wchar_t *filename, const wchar_t *charset);
```

Creates a typical email used to send EDIFACT messages. Does the following:

1. Sets the email body to the EDIFACT message passed in `message`.
2. Sets the `Content-Transfer-Encoding` to Base64.
3. Set the `Content-Type` equal to `application/EDIFACT`.
4. Sets the `Content-Type` header's name attribute to `name`.
5. Sets the `Content-Disposition` equal to `attachment`.
6. Sets the `Content-Disposition`'s `filename` attribute equal to `filename`.
7. The EDIFACT message is converted to the charset indicated by `charset`, and encoded using Base64 in the email body.

The email's subject, recipients, FROM address, and other headers are left unmodified.

This is a convenience method that constructs the customary MIME headers and body for EDIFACT transport. It replaces the existing main body configuration.

### Email.SetEncryptCert

`Chilkat 11.7.0 · wc · Email · SetEncryptCert · method`

```c
BOOL CkEmailW_SetEncryptCert(HCkEmailW cHandle, HCkCertW cert);
```

Sets the certificate in `cert` as the explicit recipient encryption certificate. Use the `CreateCS`, `CertStore`, and `Cert` classes to obtain a `Cert` object by locating a certificate in a certificate store or loading one from a file.

Use `AddEncryptCert` instead when the message must be decryptable by multiple recipients.

Returns TRUE for success, FALSE for failure.

### Email.SetFromMimeBd

`Chilkat 11.7.0 · wc · Email · SetFromMimeBd · method · since 9.5.0.62`

```c
BOOL CkEmailW_SetFromMimeBd(HCkEmailW cHandle, HCkBinDataW bindat);
```

Loads an email with the MIME stored in a `BinData` object.

**Note:** This replaces the entire contents of the email object, including the To/CC recipients.

The MIME is parsed locally and the `BinData` itself is not modified.

Returns TRUE for success, FALSE for failure.

### Email.SetFromMimeSb

`Chilkat 11.7.0 · wc · Email · SetFromMimeSb · method · since 9.5.0.62`

```c
BOOL CkEmailW_SetFromMimeSb(HCkEmailW cHandle, HCkStringBuilderW sb);
```

Loads an email with the MIME stored in a `StringBuilder` object.

**Note:** This replaces the entire contents of the email object, including the To/CC recipients.

The MIME is parsed locally and the `StringBuilder` itself is not modified.

Returns TRUE for success, FALSE for failure.

### Email.SetFromMimeText

`Chilkat 11.7.0 · wc · Email · SetFromMimeText · method`

```c
BOOL CkEmailW_SetFromMimeText(HCkEmailW cHandle, const wchar_t *mimeText);
```

Loads the email from MIME text contained in `mimeText`, such as the contents of an `.eml` file.

On success, this replaces the entire current email, including recipients, headers, bodies, related items, and attachments. An empty string is accepted and clears the current message content.

`mimeText` must be interpreted as MIME, not as body text. To set a plain-text body directly, use the `Body` property or `SetTextBody`.

This parses MIME already present in memory and does not contact a mail server.

Returns TRUE for success, FALSE for failure.

### Email.SetFromXmlText

`Chilkat 11.7.0 · wc · Email · SetFromXmlText · method`

```c
BOOL CkEmailW_SetFromXmlText(HCkEmailW cHandle, const wchar_t *xmlStr);
```

Loads an email from an XML string.

**Note:** This replaces the entire contents of the email object, including the To/CC recipients.

The XML must be in Chilkat's email serialization format, typically obtained from `GetXml`.

Returns TRUE for success, FALSE for failure.

### Email.SetHtmlBody

`Chilkat 11.7.0 · wc · Email · SetHtmlBody · method`

```c
void CkEmailW_SetHtmlBody(HCkEmailW cHandle, const wchar_t *html);
```

Sets the HTML body of an email.

This creates or replaces the `text/html` body. It does not automatically create a plain-text alternative.

### Email.SetRelatedFilename

`Chilkat 11.7.0 · wc · Email · SetRelatedFilename · method`

```c
BOOL CkEmailW_SetRelatedFilename(HCkEmailW cHandle, int index, const wchar_t *path);
```

Sets the filename for a related item within the email.

`index` is zero-based. This changes the filename stored in the related MIME part and does not rename a local source file.

Returns TRUE for success, FALSE for failure.

### Email.SetReplacePattern

`Chilkat 11.7.0 · wc · Email · SetReplacePattern · method`

```c
BOOL CkEmailW_SetReplacePattern(HCkEmailW cHandle, const wchar_t *pattern, const wchar_t *replaceString);
```

Defines a mail-merge replacement pair. `pattern` contains the pattern to find, and `replaceString` contains the replacement text.

When the email is sent by a `MailMan` sending method, occurrences of `pattern` are replaced with `replaceString`. To define multiple replacement pairs, call this method once for each pair. The `MailMan` method `RenderToMime` also performs these replacements. Methods such as `SaveEml` and `GetMime` do not.

`pattern` may occur in any header field and in either an HTML or plain-text body. Defining the pair does not immediately alter the stored body or headers; replacement occurs later during supported rendering or sending operations.

Returns TRUE for success, FALSE for failure.

### Email.SetSigningCert

`Chilkat 11.7.0 · wc · Email · SetSigningCert · method`

```c
BOOL CkEmailW_SetSigningCert(HCkEmailW cHandle, HCkCertW cert);
```

Sets the certificate in `cert` for creating a digital signature. Use the `CreateCS`, `CertStore`, and `Cert` classes to obtain a `Cert` object by locating a certificate in a certificate store or loading one from a file.

`cert` must have access to its private key when signing occurs. Use `SetSigningCert2` when the private key is supplied separately.

Returns TRUE for success, FALSE for failure.

### Email.SetSigningCert2

`Chilkat 11.7.0 · wc · Email · SetSigningCert2 · method`

```c
BOOL CkEmailW_SetSigningCert2(HCkEmailW cHandle, HCkCertW cert, HCkPrivateKeyW key);
```

Explicitly sets the certificate in `cert` and the corresponding private key in `key` for sending digitally signed email.

If `cert` already has access to its private key, it is usually sufficient to call `SetSigningCert`. On Windows, Chilkat automatically searches the system certificate stores and Windows Protected Store for the corresponding certificate and private key. On macOS, Chilkat automatically searches the Keychain.

In many cases, it is not necessary to set the signing certificate explicitly. Chilkat can automatically locate a certificate whose email address matches the email's `From` address, provided the certificate and private key are installed in a searchable certificate store or Keychain.

Use this method when the private key is held separately from the certificate. `cert` and `key` must correspond to one another.

Returns TRUE for success, FALSE for failure.

### Email.SetTextBody

`Chilkat 11.7.0 · wc · Email · SetTextBody · method`

```c
void CkEmailW_SetTextBody(HCkEmailW cHandle, const wchar_t *bodyText, const wchar_t *contentType);
```

Sets the body of the email and also sets the `Content-Type` header field of `contentType`. If the email is already multipart/alternative, an additional alternative with the indicated `Content-Type` will be added. If an alternative with the same `Content-Type` already exists, it is replaced.

Use a textual MIME type such as `text/plain` or `text/html`. When building a plain-text/HTML pair, the dedicated alternative-body methods make the intended `multipart/alternative` structure clearer.

### Email.ToDsn

`Chilkat 11.7.0 · wc · Email · ToDsn · method · since 11.0.0`

```c
BOOL CkEmailW_ToDsn(HCkEmailW cHandle, const wchar_t *explanation, const wchar_t *statusFields, BOOL headerOnly, HCkEmailW dsnEmail);
```

Creates a new Delivery Status Notification (DSN) email in the format specified by RFC 3464. The DSN email is generated in `dsnEmail`.

The source email is not modified. Populate any additional sender or recipient fields on `dsnEmail` before sending the generated notification.

Returns TRUE for success, FALSE for failure.

### Email.ToForward

`Chilkat 11.7.0 · wc · Email · ToForward · method · since 11.0.0`

```c
BOOL CkEmailW_ToForward(HCkEmailW cHandle, HCkEmailW fwdEmail);
```

Creates an inline-forward email in `fwdEmail` based on this email.

The source email is not modified. `fwdEmail` can be edited to add recipients, introductory text, or other forwarding details before sending.

Returns TRUE for success, FALSE for failure.

### Email.ToMdn

`Chilkat 11.7.0 · wc · Email · ToMdn · method · since 11.0.0`

```c
BOOL CkEmailW_ToMdn(HCkEmailW cHandle, const wchar_t *message, const wchar_t *statusFields, BOOL headerOnly, HCkEmailW mdn);
```

Creates a new MDN (Message Disposition Notification) email in `mdn` using the format specified by RFC 3798.

The source email is not modified. Populate any additional sender or recipient fields on `mdn` before sending the generated notification.

Returns TRUE for success, FALSE for failure.

### Email.ToReply

`Chilkat 11.7.0 · wc · Email · ToReply · method · since 11.0.0`

```c
BOOL CkEmailW_ToReply(HCkEmailW cHandle, HCkEmailW reply);
```

Generates a reply email in `reply` with updated header and body fields to enable sending as a reply. Note: Attachments are excluded from the reply, but attached messages are included. To exclude attached messages, call `RemoveAttachedMessages` on the reply email object.

The source email is not modified. `reply` can be edited to add introductory text, adjust recipients, or change reply behavior before sending.

Returns TRUE for success, FALSE for failure.

### Email.UidlEquals

`Chilkat 11.7.0 · wc · Email · UidlEquals · method`

```c
BOOL CkEmailW_UidlEquals(HCkEmailW cHandle, HCkEmailW e);
```

Returns `TRUE` if this email's UIDL equals the UIDL of the email passed in `e`.

This comparison is meaningful for messages obtained through POP3. It does not compare IMAP UIDs, MIME `Message-ID` values, or message content.

### Email.UnpackHtml

`Chilkat 11.7.0 · wc · Email · UnpackHtml · method`

```c
BOOL CkEmailW_UnpackHtml(HCkEmailW cHandle, const wchar_t *unpackDir, const wchar_t *htmlFilename, const wchar_t *partsSubdir);
```

Unpacks an HTML email into an HTML file and separate related files, such as images and style sheets. Links in the HTML are rewritten to reference the extracted files.

`unpackDir` specifies the destination directory for the HTML file, `htmlFilename` specifies the HTML filename, and `partsSubdir` specifies the subdirectory beneath `unpackDir` where related files are written. Chilkat creates the related-files subdirectory when necessary.

**Example:** If `unpackDir` is `C:/test`, `htmlFilename` is `myEmail.html`, and `partsSubdir` is `images`, Chilkat writes `C:/test/myEmail.html` and stores related files in `C:/test/images`.

**Note:** Only related content physically contained in the email can be extracted. Images referenced by external web URLs are not downloaded.

The extracted filenames originate from message content and should be treated as untrusted when processing email from unknown senders. The method operates on data already present in the email object.

Returns TRUE for success, FALSE for failure.

### Email.UnSpamify

`Chilkat 11.7.0 · wc · Email · UnSpamify · method`

```c
void CkEmailW_UnSpamify(HCkEmailW cHandle);
```

Unobfuscates emails by undoing what spammers do to obfuscate email. It removes comments from HTML bodies and unobfuscates hyperlinked URLs.

This modifies the current email content. Make a copy first when the original HTML must be preserved for forensic or auditing purposes.

### Email.UnzipAttachments

`Chilkat 11.7.0 · wc · Email · UnzipAttachments · method`

```c
BOOL CkEmailW_UnzipAttachments(HCkEmailW cHandle);
```

Unzips and replaces any Zip file attachments with the expanded contents. As an example, if an email contained a single Zip file containing 3 GIF image files as an attachment, then after calling this method the email would contain 3 GIF file attachments, and the Zip attachment would be gone.If an email contains multiple Zip file attachments, each Zip is expanded and replaced with the contents.

This changes the attachment collection in memory; it does not extract files directly to a filesystem directory. Save the resulting attachments separately when files are required on disk.

Returns TRUE for success, FALSE for failure.

### Email.UseCertVault

`Chilkat 11.7.0 · wc · Email · UseCertVault · method · since 9.5.0.40`

```c
BOOL CkEmailW_UseCertVault(HCkEmailW cHandle, HCkXmlCertVaultW vault);
```

Adds the XML certificate vault in `vault` to the object's internal certificate and private-key lookup sources for encryption, decryption, signing, and verification.

Unlike `AddPfxSourceData` and `AddPfxSourceFile`, only one XML certificate vault can be used. Each call replaces the vault supplied by the previous call, so only the most recent `vault` remains in use.

`vault` becomes a lookup source for subsequent operations by this object. Adding it does not immediately sign, verify, encrypt, or decrypt anything.

Returns TRUE for success, FALSE for failure.

### Email.ZipAttachments

`Chilkat 11.7.0 · wc · Email · ZipAttachments · method`

```c
BOOL CkEmailW_ZipAttachments(HCkEmailW cHandle, const wchar_t *zipFilename);
```

Replaces all the attachments of an email with a single Zip file attachment having the filename specified.

The original attachments are removed from the in-memory email and their contents are placed into the new Zip attachment. Related items and attached emails are separate.

Returns TRUE for success, FALSE for failure.

## Deprecated members — do not use in new code

| Member | Kind | Deprecated in | Use instead |
|---|---|---|---|
| `BounceAddress` | property | before 11.6.1 | — |
| `AddDataAttachment` | method | before 11.6.1 | — |
| `AddDataAttachment2` | method | before 11.6.1 | — |
| `AddPfxSourceData` | method | before 11.6.1 | — |
| `AddRelatedData` | method | before 11.6.1 | — |
| `AddRelatedData2` | method | before 11.6.1 | — |
| `AspUnpack2` | method | before 11.6.1 | — |
| `AttachMessage` | method | before 11.6.1 | — |
| `BEncodeBytes` | method | before 11.6.1 | — |
| `Clone` | method | before 11.6.1 | `MakeCopy` |
| `CreateDsn` | method | before 11.6.1 | `ToDsn` |
| `CreateForward` | method | before 11.6.1 | `ToForward` |
| `CreateMdn` | method | before 11.6.1 | `ToMdn` |
| `CreateReply` | method | before 11.6.1 | `ToReply` |
| `FindIssuer` | method | before 11.6.1 | — |
| `GetAttachedMessage` | method | before 11.6.1 | `GetAttachedEmail` |
| `GetAttachmentData` | method | before 11.6.1 | — |
| `GetDigest` | method | before 11.6.1 | `GetDigestEmail` |
| `GetDsnFinalRecipients` | method | before 11.6.1 | `GetDsnInfo` |
| `GetDt` | method | before 11.6.1 | — |
| `GetEncryptCert` | method | before 11.6.1 | — |
| `GetEncryptedByCert` | method | before 11.6.1 | `LastDecryptCert` |
| `GetFileContent` | method | before 11.6.1 | — |
| `GetLinkedDomains` | method | before 11.6.1 | `LinkedDomains` |
| `GetMimeBinary` | method | before 11.6.1 | — |
| `GetNthBinaryPartOfType` | method | before 11.6.1 | — |
| `GetRelatedData` | method | before 11.6.1 | — |
| `GetSignedByCert` | method | before 11.6.1 | `LastSignerCert` |
| `GetSignedByCertChain` | method | before 11.6.1 | — |
| `GetSigningCert` | method | before 11.6.1 | — |
| `QEncodeBytes` | method | before 11.6.1 | — |
| `SetBinaryBody` | method | before 11.6.1 | — |
| `SetFromMimeBytes` | method | before 11.6.1 | — |
| `SetFromMimeBytes2` | method | before 11.6.1 | — |
| `SetMbHtmlBody` | method | before 11.6.1 | — |
| `SetMbPlainTextBody` | method | before 11.6.1 | — |

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/BinData.md), [`Cert`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/Cert.md), [`CkDateTime`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/CkDateTime.md), [`JsonObject`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/JsonObject.md), [`PrivateKey`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/PrivateKey.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/StringBuilder.md), [`StringTable`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/StringTable.md), [`Task`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/Task.md), [`XmlCertVault`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/wc/classes/XmlCertVault.md)

