Listener Class |
Namespace: SMTPRouter
The Listener type exposes the following members.
| Name | Description | |
|---|---|---|
| Listener |
Initializes a new instance of a Smtp Listener
| |
| Listener(String, Int32) |
Initializes a new instance of a Smtp Listener
| |
| Listener(String, Int32, Boolean) |
Initializes a new instance of a Smtp Listener
| |
| Listener(String, Int32, Boolean, Boolean) |
Initializes a new instance of a Smtp Listener
|
| Name | Description | |
|---|---|---|
| IsListening |
Defines whether the Listener is active or not
| |
| Ports |
Ports where the SMTP Service will be available
| |
| RequiresAuthentication |
Defines whether the SMTP Requires authentication
| |
| Server |
Reference to the SmtpServer
| |
| ServerName |
Name of the Server where the services will run
| |
| UseSSL |
Defines whether it's necessary to use SSL or not
|
| Name | Description | |
|---|---|---|
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| StartAsync |
Initializes a new instance of the Listener
| |
| ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
| ListeningStarted |
Event triggered when the Listener started to listen to smtp messages
| |
| MessageReceived |
Event triggered when a message is received
| |
| SessionCommandExecuting |
Event triggered when an SMTP Command is executing
| |
| SessionCompleted |
Event triggered when an SMTP Session is completed
| |
| SessionCreated |
Event triggered when an SMTP Session is created
|
// Create the Listener var listener = new SMTPRouter.Listener() { ServerName = "localhost", Ports = new int[] { 25, 587 }, RequiresAuthentication = false, UseSSL = false }; // Hook into events listener.ListeningStarted += Server_ListeningStarted; listener.SessionCreated += Server_SessionCreated; listener.SessionCommandExecuting += Server_SessionCommandExecuting; listener.SessionCompleted += Server_SessionCompleted; listener.MessageReceived += Server_MessageReceived;