Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Iterate Email HeadersDemonstrates how to iterate over the email header fields.
Chilkat.Email email = new Chilkat.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) { MessageBox.Show(email.LastErrorText); return; } // How many header fields? int n; n = email.NumHeaderFields; if (n > 0) { // Display the name and value of each header: int i; string name; string value; for (i = 0; i <= n - 1; i++) { name = email.GetHeaderFieldName(i); value = email.GetHeaderFieldValue(i); textBox1.Text += Convert.ToString(i) + "\r\n"; textBox1.Text += name + "\r\n"; textBox1.Text += value + "\r\n"; } } |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.