Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) Iterate Email HeadersDemonstrates how to iterate over the email header fields.
#include <CkEmail.h> void ChilkatSample(void) { CkString strOut; CkEmail email; // First, load an email from a file. // Note: an email object may be loaded from a file, or // downloaded directly from a POP3 or IMAP server... bool success; success = email.LoadEml("testReceivedHdrs.eml"); if (success != true) { strOut.append(email.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } // How many header fields? int n; n = email.get_NumHeaderFields(); if (n > 0) { // Display the name and value of each header: int i; const char *name = 0; const char *value = 0; for (i = 0; i <= n - 1; i++) { name = email.getHeaderFieldName(i); value = email.getHeaderFieldValue(i); strOut.appendInt(i); strOut.append("\r\n"); strOut.append(name); strOut.append("\r\n"); strOut.append(value); strOut.append("\r\n"); } } SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.