TROEmailServerThread

Overview

The TROEmailServerThread object represents the email server thread that processes all request messages that are passed from the client to the server. You can use the TROEmailServerThread to check, process and sent email messages with output data for all email messages with input data when building a custom email server. To configure the TROEmailServerThread class, you have to set the values of the Pop3Password, Pop3ServerAddress, Pop3UserName, ServerEmail and SmtpServerAddress properties of the custom email server.

Location


 

constructor Create (Boolean, string)    (declared in TROThread)

Initializes the instance with the given arguments.

constructor Create(aCreateSuspended: Boolean; const aName: string)

Parameters:

  • aCreateSuspended: If true, Execute won’t be called until after Resume is called; if false, Execute is called immediately.
  • aName: Become the value of the Name property.

constructor Create (string, TComponent, Integer)  reintroduce    (declared in TROServerCheckMessageThread)

Creates the object instance and sets the specific parameters.

constructor Create(aName: string; aOwner: TComponent; aInterval: Integer)

Parameters:

  • aName: Name of the thread.
  • aOwner: Points to the component (for example the server) that has spawned this thread object.
  • aInterval: Time interval in seconds to perform the periodic action.

constructor Create (TROCustomEmailServer)  reintroduce

Creates a new email server thread with the specified name RemObjects Email Server Worker Thread, the email server owner (parameter aOwner) and the POP3 check interval. The POP3 check interval is the property of the email server that owns the current TROEmailServerThread object.

constructor Create(aOwner: TROCustomEmailServer)

Parameters:

  • aOwner: Owner server of the current TROEmailServerThread object

constructor Create (Boolean)    (declared in TROInitializedThread)

Creates a new class instance (standard thread class constructor).

constructor Create(CreateSuspended: Boolean)

Parameters:

  • CreateSuspended: When set to true, this parameter allows to create a thread that will not be started right after it is created. This allows to do some thread class configuration before the execution begins.

Active    (declared in TROServerCheckMessageThread)

Allows to start and stop the periodic action execution. When being assigned, the property value is copied to the underlying TThread.Suspended property.

property Active: Boolean read write

CheckForMessages  protected override

Checks for request messages that were passed from the clients to the email server. For each request message a new message thread that processes this request and sends the response is created.

procedure CheckForMessages

DoTerminate  protected override    (declared in TROThread)

procedure DoTerminate

Execute  protected override    (declared in TROInitializedThread)

This method will be executed on the background thread, and should contain the user code. In this class, the Execute method must not be overridden in descendant classes, override IntExecute instead.

procedure Execute

Free  reintroduce    (declared in TROThread)

procedure Free

Name  protected    (declared in TROThread)

Sets a readable name for the thread.

property Name: string read

Owner  protected    (declared in TROServerCheckMessageThread)

Points to the component (for example the server) that has spawned this thread object.

property Owner: TComponent read

ProcessMessage  protected

Creates a new email server process message thread (TROEmailServerProcessMessageThread) that processes the request and sends the response. aRequest defines the input data, aMessageID defines the GUID of the request message and aFrom defines the client's email address.

procedure ProcessMessage(aRequest: TStream; const aMessageID: string; const aFrom: string)

Parameters:

  • aRequest: Input stream with data
  • aMessageID: GUID of the request message
  • aFrom: Client's email address

SetName  protected    (declared in TROThread)

procedure SetName(const aName: string)

Parameters:

  • aName:

TerminateWaitFor  override    (declared in TROServerCheckMessageThread)

Utility method that combines a call to Terminate with a subsequent call to WaitFor.

procedure TerminateWaitFor

WaitFor  reintroduce    (declared in TROThread)

Blocks the current thread until the current event receives a signal.

function WaitFor: Cardinal

 

Active    (declared in TROServerCheckMessageThread)

Allows to start and stop the periodic action execution. When being assigned, the property value is copied to the underlying TThread.Suspended property.

property Active: Boolean read write

Name  protected    (declared in TROThread)

Sets a readable name for the thread.

property Name: string read

Owner  protected    (declared in TROServerCheckMessageThread)

Points to the component (for example the server) that has spawned this thread object.

property Owner: TComponent read

 

constructor Create (Boolean, string)    (declared in TROThread)

Initializes the instance with the given arguments.

constructor Create(aCreateSuspended: Boolean; const aName: string)

Parameters:

  • aCreateSuspended: If true, Execute won’t be called until after Resume is called; if false, Execute is called immediately.
  • aName: Become the value of the Name property.

constructor Create (string, TComponent, Integer)  reintroduce    (declared in TROServerCheckMessageThread)

Creates the object instance and sets the specific parameters.

constructor Create(aName: string; aOwner: TComponent; aInterval: Integer)

Parameters:

  • aName: Name of the thread.
  • aOwner: Points to the component (for example the server) that has spawned this thread object.
  • aInterval: Time interval in seconds to perform the periodic action.

constructor Create (TROCustomEmailServer)  reintroduce

Creates a new email server thread with the specified name RemObjects Email Server Worker Thread, the email server owner (parameter aOwner) and the POP3 check interval. The POP3 check interval is the property of the email server that owns the current TROEmailServerThread object.

constructor Create(aOwner: TROCustomEmailServer)

Parameters:

  • aOwner: Owner server of the current TROEmailServerThread object

constructor Create (Boolean)    (declared in TROInitializedThread)

Creates a new class instance (standard thread class constructor).

constructor Create(CreateSuspended: Boolean)

Parameters:

  • CreateSuspended: When set to true, this parameter allows to create a thread that will not be started right after it is created. This allows to do some thread class configuration before the execution begins.

CheckForMessages  protected override

Checks for request messages that were passed from the clients to the email server. For each request message a new message thread that processes this request and sends the response is created.

procedure CheckForMessages

DoTerminate  protected override    (declared in TROThread)

procedure DoTerminate

Execute  protected override    (declared in TROInitializedThread)

This method will be executed on the background thread, and should contain the user code. In this class, the Execute method must not be overridden in descendant classes, override IntExecute instead.

procedure Execute

Free  reintroduce    (declared in TROThread)

procedure Free

ProcessMessage  protected

Creates a new email server process message thread (TROEmailServerProcessMessageThread) that processes the request and sends the response. aRequest defines the input data, aMessageID defines the GUID of the request message and aFrom defines the client's email address.

procedure ProcessMessage(aRequest: TStream; const aMessageID: string; const aFrom: string)

Parameters:

  • aRequest: Input stream with data
  • aMessageID: GUID of the request message
  • aFrom: Client's email address

SetName  protected    (declared in TROThread)

procedure SetName(const aName: string)

Parameters:

  • aName:

TerminateWaitFor  override    (declared in TROServerCheckMessageThread)

Utility method that combines a call to Terminate with a subsequent call to WaitFor.

procedure TerminateWaitFor

WaitFor  reintroduce    (declared in TROThread)

Blocks the current thread until the current event receives a signal.

function WaitFor: Cardinal