Archived Forum Post

Index of archived forum posts

Question:

getMime() results in email containing ckx-* headers, can they be removed?

Feb 08 '13 at 08:29

Using the CkEmail method, getMime() the resulting email string contains the "ckx-imap-" headers. Any way to remove this before we use getMime()? I know there is a RemoveHeader method, but does anyone have a list of all the ckx-imap headers?

Thanks!

hz


Answer

Iterate over the header fields and remove each that begins with "ckx-imap-".

For example:

int i;
CkString strName;
CkStringArray saNames;
saNames.put_Unique(true);

int n = email.NumHeaderFields(); for (i=0; i<n; i++) { email.GetHeaderFieldName(i,strName); if (strName.beginsWith("ckx-imap-")) { saNames.Append(strName.getString()); } } n = saNames.get_Count(); for (i=0; i<n; i++) { email.RemoveHeaderField(saNames.getString(i)); }