Gets the HeaderCollection of the email message.
[Visual Basic] Public Property Headers As HeaderCollection
[C#] public HeaderCollection Headers{get;}
[C++] public: __property HeaderCollection^ get_Headers();
[JScript] public function get Headers() : HeaderCollection;
Property Value
Example
[Visual Basic, C#, C++] To get the full samples of EAGetMail, please refer to Samples section.
[Visual Basic - Parse Headers] Imports EAGetMail Public Sub ParseHeaders() Dim oMail As New Mail("TryIt") oMail.Load("c:\test.eml", False) Dim oHeaders As HeaderCollection = oMail.Headers Dim count As Integer = oHeaders.Count For i As Integer = 0 To count - 1 Dim oHeader As HeaderItem = oHeaders(i) Console.WriteLine("{0}: {1}", oHeader.HeaderKey, oHeader.HeaderValue) Next End Sub
[C# - Parse Headers] using System; using EAGetMail; public static void ParseHeaders() { Mail oMail = new Mail("TryIt"); oMail.Load("c:\\test.eml", false); HeaderCollection oHeaders = oMail.Headers; int count = oHeaders.Count; for(int i = 0; i < count; i++) { HeaderItem oHeader = oHeaders[i] as HeaderItem; Console.WriteLine("{0}: {1}", oHeader.HeaderKey, oHeader.HeaderValue); } }
[C++/CLI - Parse Headers] using namespace System; using namespace EAGetMail; Void ParseHeaders() { Mail ^oMail = gcnew Mail("TryIt"); oMail->Load("c:\\test.eml", false); HeaderCollection ^oHeaders = oMail->Headers; int count = oHeaders->Count; for(int i = 0; i < count; i++) { HeaderItem ^oHeader = dynamic_cast<HeaderItem^>(oHeaders->Item[i]); Console::WriteLine("{0}: {1}", oHeader->HeaderKey, oHeader->HeaderValue); } }
See Also
HeaderCollection Class
HeaderItem Class
Online Tutorials