Pop3DownloadMessageHeader Method (Int32) |
Downloads the header of the specified message from the server.
Namespace: MailBee.Pop3MailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public MailMessage DownloadMessageHeader(
int index
)
Public Function DownloadMessageHeader (
index As Integer
) As MailMessage
Parameters
- index
- Type: SystemInt32
The ordinal position of the message in the inbox.
It must be in the range from 1 to InboxMessageCount.
Can be negative in the range from -1 to -InboxMessageCount, i.e. -1 denotes the last e-mail in the inbox.
Return Value
Type:
MailMessageOn success, a
MailMessage object containing the downloaded message header;
otherwise, a null reference (
Nothing in Visual Basic).
Exceptions Remarks Examples This sample downloads header of the last message from an inbox on a POP3 server,
and prints e-mail addresses of all the recipients of this message.
using MailBee;
using MailBee.Pop3Mail;
using MailBee.Mime;
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
MailMessage msg = pop.DownloadMessageHeader(pop.InboxMessageCount);
EmailAddressCollection recipients = msg.GetAllRecipients();
foreach (EmailAddress address in recipients)
{
Console.WriteLine(address.Email);
}
pop.Disconnect();
Imports MailBee
Imports MailBee.Pop3Mail
Imports MailBee.Mime
Dim pop As New Pop3
pop.Connect("mail.domain.com")
pop.Login("jdoe", "secret")
Dim msg As MailMessage
msg = pop.DownloadMessageHeader(pop.InboxMessageCount)
Dim recipients As EmailAddressCollection
recipients = msg.GetAllRecipients()
For Each address As EmailAddress In recipients
Console.WriteLine(address.Email)
Next
pop.Disconnect()
See Also