Pop3DataReceived Event
Occurs when data is received from the POP3 server.

Namespace: MailBee.Pop3Mail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public event DataTransferEventHandler DataReceived

Value

Type: MailBeeDataTransferEventHandler
Remarks

Unlike LowLevelDataReceived event, occurrence of this event indicates receiving POP3-related data only. For instance, if the transmission channel is SSL-encrypted, LowLevelDataReceived event indicates receiving of encrypted data, while DataReceived will be raised later (after decrypting the data). If the transmission channel is not encrypted or otherwise scrambled, DataReceived and LowLevelDataReceived are equivalent.

Unlike MessageDataChunkReceived event, DataReceived will be raised when any POP3-related data is received, while MessageDataChunkReceived event is raised only when message header or entire message data is downloaded.

Note Note
This event is also raised when zero-length data is received from the server. When the server sends zero-length data portion, it means the server closed the connection. This normally happens after Disconnect method was called.
Examples
This sample prints all the data received from the server during POP3 session into console.
using System;
using MailBee;
using MailBee.Pop3Mail;

class Sample
{
    // DataReceived event handler.
    private static void OnDataReceived(object sender, DataTransferEventArgs e)
    {
        Console.WriteLine("[" + System.Text.Encoding.Default.GetString(e.Data) + "]");
    }

    // The actual code.
    static void Main(string[] args)
    {
        Pop3 pop = new Pop3();

        // Subscribe to the DataReceived event.
        pop.DataReceived += new DataTransferEventHandler(OnDataReceived);

        // Do something which would produce some network traffic.
        pop.Connect("mail.domain.com");
        pop.Login("jdoe", "secret");
        pop.Disconnect();
    }
}
See Also