Pop3ExecuteCustomCommand Method
Sends user-defined command to the server and receives the server response to this command.

Namespace: MailBee.Pop3Mail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public bool ExecuteCustomCommand(
	string commandString,
	bool multiLineResponse
)

Parameters

commandString
Type: SystemString
User-defined command text (including line terminator).
multiLineResponse
Type: SystemBoolean
true if the given command returns multi-line response on success; false if the given command always produces single-line response.

Return Value

Type: Boolean
true if the command was executed successfully; otherwise, false.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks
The developer can use GetServerResponse method to obtain the response data returned by the server.
Examples
This sample connects to the POP3 server, issues HELP command, and displays the server response to this command. If HELP command is not supported by the server, MailBee will throw MailBeePop3NegativeResponseException. It's caught in the sample code, and the proper error message is displayed.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Pop3Mail;

// The actual code (put it into a method of your class).
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
try
{
    // Send HELP command (it produces a single-line response).
    pop.ExecuteCustomCommand("HELP\r\n", false);
    Console.WriteLine(pop.GetServerResponse());
}
catch (MailBeePop3NegativeResponseException e)
{
    // The given POP3 server does not support HELP command.
    Console.WriteLine(e.Message);
    Console.WriteLine("Server response is: " + pop.GetServerResponse());
}
pop.Disconnect();
See Also