Constructor
Create a new SMTP server instance.SMTPServerOptions
Configuration options for the server. See Configuration for all available options.
Methods
listen()
Start the SMTP server and bind to a port.number
Port number to bind to
string
default:"0.0.0.0"
Hostname or IP address to bind to
() => void
Function called when the server starts listening
this (for chaining)
The
listening event is emitted after the server successfully binds to the port.close()
Gracefully shut down the server. Active connections are allowed to finish within thecloseTimeout period.
() => void
Function called when the server has fully closed
this (for chaining)
updateSecureContext()
Hot-reload TLS certificates without restarting the server. New connections will use the updated certificates.object
required
Event Methods
on()
Register an event listener.function
required
Callback function to invoke when the event is emitted
this (for chaining)
once()
Register a one-time event listener that is automatically removed after firing once.string
required
Event name
function
required
Callback function to invoke once
this (for chaining)
off()
Remove an event listener.string
required
Event name
function
required
The exact listener function to remove
this (for chaining)
Properties
SMTPServerOptions
The resolved configuration options (defaults merged with constructor options)
Set<ConnectionContext>
Set of currently active connections
boolean
Whether the server is in the process of shutting down