TROEmailChannel
From RemObjects Software
This is a RemObjects SDK Architecture entry
Feel free to add your notes to this topic below.
Overview
TROEmailChannel implements a channel that uses the standard email infrastructure to send messages between client and server. The channel is based on the open source Indy components that ship with Delphi.
Due to the nature of how email delivery works, this channel is best-suited for asynchronous communications and scenarios where a response to a request is not expected in real time or even during the lifetime of the application.
File
- uROIndyEmailChannel
Declaration
TROEmailChannel = class(TROCustomEmailChannel);
Hierarchy
- TROComponent
- TROBaseConnection
- TROTransportChannel
- TROCustomEmailChannel
- TROEmailChannel
- TROCustomEmailChannel
- TROTransportChannel
- TROBaseConnection
Properties
| | | |
|---|---|---|
| ClientEmail | String | This is the email address of the client. It will be used in the "From:" field of sent emails, and the server will evaluate to obtain the return address for its responses.This email address should match the POP3 account configured for the client, so that the client will be able to access the responses directed at it. |
| DeleteOldResponses | Boolean | Allows old/unmatched response emails to be automatically deleted as part of the POP3 polling process (default is false). Enable this option if the POP3 account is used exclusively by this one client, and the account should be automatically cleaned of all unexpected or old response emails that might still be in the inbox.
Keep this option disabled if several client applications will be sharing the POP3 account, so that they will not delete each other's messages. Note: the email channel will never delete any email messages that did not originate from a RemObjects SDK server. So it is completely safe to use the channel on a POP3 account that is also used for normal email correspondence. |
| DispatchOptions | TRODispatchOptions | Configures the available fail-over and load balancing options provided by the RemObjects SDK.
By default, channels are set up to talk to one specific server only. Two independent options are available to provide fail-over and load balancing:
Enabling any of these options obviously requires the server to be implemented in a stateless way, so that it does not depend on all requests from a client going to the same server. This implies using a class factory different from Per-Client and, if sessions are used, a session manager that allows sharing of session state between servers. |
| Pop3Client | TIdPOP3 | Provides direct access to the underlying Indy POP3 Client implementation.
You can use this property to control advanced settings on the Indy POP3 object, such as setting authentication options. The available properties and settings depend on the version of Indy you are using.The SmtpClient property can be used to control advanced options. |
| Pop3Password | String | Defines the password to be used to authenticate with the POP3 server. |
| Pop3ServerAddress | String | This address of the POP3 server will be used to collect response emails. This can be a host name or an IP address, and should point to the POP3 server where the email specified in ClientEmail will be delivered. |
| Pop3Username | String | The login name to be used to authenticate with the POP3 server. |
| ProbeFrequency | Cardinal | Sets at what intervals, in milliseconds, the channel will probe the servers configured in ServerLocators for availability. The default value is 60,000 (60 seconds). See the ProbeServers property for a more detailed description.
Although somewhat misnamed, this property defines the Interval between probes, not the actual probing Frequency. The property name is persisted for backward compatibility. |
| ProbeServers | Boolean | Toggles whether the channel will continuously probe the servers configured in ServerLocators for availability.
If enabled (true), the channel will ping all servers at a regular interval to determine if they are reachable. If a server fails to respond, it will be disabled for future calls until a later probe can reach it again. The interval between probes can be configured using the ProbeFrequency property. By default, server probing is turned off. |
| ServerEmail | String | The server's email address. It will be used in the "To:" field of sent emails to deliver them to the server. This email address should match the POP3 account configured for the server. |
| ServerLocators | TROServerLocatorCollection | Optionally, this collection property can be filled to contain a list of possible servers to be used for fail-over or load balancing purposes.
Depending on the settings configured in DispatchOptions, the channel will automatically spread calls over the available servers, or fall back to another server if one fails. |
| SmtpClient | TIdSMTP | Provides direct access to the underlying Indy SMTP Client implementation. You can use this property to control advanced settings on the Indy SMTP object, such as setting authentication options.The available properties and settings depend on the version of Indy you are using. |
| SmtpServerAddress | String | This address of the SMTP server will be used to dispatch outgoing messages. It can be a host name or an IP address, and can be any SMTP server capable of relaying mails to the destination, including an open relay or the ISP's email server. The SmtpClient property can be used to control advanced options such as authentication. |
| SynchronizedProbing | Boolean | Determines whether server probing happens in the context of the main VCL thread (true, default) or in a background worker thread.
See the ProbeServers property for a more detailed description. |
Events
| | |
|---|---|
| OnAfterProbingServer | Fires after the channel is done probing a specific server for availability.
You can use this event to check the result of the probing, possibly to update internal data structures or to display server status in the user interface. |
| OnAfterProbingServers | Fires after the channel is done probing all servers for availability.
You can use this event to check the result of the probing, possibly to update internal data structures or to display server status in the user interface. |
| OnBeforeProbingServer | Fires before the channel starts probing a specific server for availability.
You can use this event to:
|
| OnBeforeProbingServers | Fires before the channel starts probing all servers for availability.
You can use this event:
|
| OnLoginNeeded | Fires if an EROSessionNotFound (or the descendant SessionNotFoundException) exception is raised during the execution of a remote request.
This usually indicates that the server cannot authenticate the client or that the session has expired. The most common use for this event is to perform a call to a special Login service provided by the server (possibly after prompting the user to enter username and password), and to set the aRetry parameter to true if login was successful. |
| OnReceiveStream | Fires after a stream with a response message has been received from the server.
Use this event handler to inspect and possibly modify the stream, before it continues to be processed by the higher levels of the RemObjects SDK framework. |
| OnSendStream | Fires just as a stream with a request message will be sent to the server.
The event handler can inspect and possibly modify the stream, before it continues to be sent off to the server. |
See Also
Product: RemObjects SDK
Current version: RemObjects SDK 'Vinci' (5.0)
Lists — Glossary — Features — How To — Components — Tools — Samples — Articles — Architecture — Issues
Categories: Text | RemObjects SDK | Architecture | Class | Component | Delphi
