Ignition 8.1.48 modules should submit email through the Gateway-managed SMTP profile instead of copying its hostname, port, TLS settings, username, or password into module code. The request path is: module code to GatewayContext, then EmailProfileManager, then the named EmailProfile, and finally sendEmail. This preserves the Gateway as the owner of SMTP configuration and credentials.
Where Should the SMTP Request Start?
Follow the packet. The module creates the message, but the managed email profile supplies the connection policy and sends it toward the SMTP server. Retrieving every underlying setting adds a second configuration path and makes the module responsible for secrets, TLS behavior, and future profile changes.
| Hop | Reading or object | Meaning | Next check |
|---|---|---|---|
| Module | Configured profile name and message | The request has enough information to select a Gateway resource | Obtain the profile manager |
| Gateway | EmailProfileManager |
The module has reached the managed mail subsystem | Resolve the profile by name |
| Profile | EmailProfile |
The requested managed profile exists | Call sendEmail
|
| Network | Link, route, name resolution, and TCP connection | The Gateway can reach the configured SMTP endpoint | Evaluate TLS and SMTP behavior |
| SMTP service | Acceptance or rejection response | The server accepted or rejected the transaction | Verify delivery independently |
Direct access to the profile's underlying settings is possible through the same general subsystem, but it is the wrong dependency when the module's actual job is sending mail. Pass the message to the managed profile unless the module truly must display or migrate configuration. Never copy the profile password into logs, diagnostics, module configuration, or exception text.
Does the Gateway Version Expose the Required Manager?
The first decision is API compatibility. EmailProfileManager, in package com.inductiveautomation.ignition.gateway.mail, was introduced in Ignition 8.1.24. Ignition 8.1.48 is therefore above the introduction point and can use this interface.
| Gateway version | Decision | Module consequence |
|---|---|---|
8.1.48 |
Use EmailProfileManager
|
Resolve and invoke the Gateway-managed profile |
8.1.24 or later |
The interface is available | Set the module's supported-version floor accordingly |
Earlier than 8.1.24
|
This interface is outside that runtime's API | Reject the version during compatibility checks or provide a separately designed legacy path |
Compile-time success alone is not the deciding test. The installed Gateway runtime must also satisfy the module's declared compatibility floor. Otherwise, class loading or linkage can fail before any SMTP request reaches the network.
Can the Module Resolve the Named Profile?
After obtaining the manager from GatewayContext, resolve the email profile by its configured name. Treat that name as a module setting rather than embedding it throughout the code. A missing result means the data path stopped inside the Gateway; changing ports, certificates, or firewall rules cannot repair a name-resolution failure.
- Read the profile name from the module's configuration.
- Obtain the Gateway email profile manager through
GatewayContext. - Ask the manager for the profile with that name.
- If no profile resolves, report the profile name and stop before constructing a network diagnosis.
- If an
EmailProfileresolves, hand the prepared message tosendEmail.
GatewayContext
-> EmailProfileManager
-> resolve profile by configured name
-> EmailProfile
-> sendEmail(message)
This object path is the stable integration boundary. It avoids making the module interpret whether a hostname, port, SSL option, STARTTLS option, username, and password form a valid combination.
Where Does the Request Stop After Profile Resolution?
Layer one first. Once profile lookup succeeds, locate the last successful hop before changing application settings. Inspect the Gateway host's network link and routing, then name resolution, TCP establishment, TLS negotiation when configured, SMTP authentication, and message acceptance—in that order.
| Check | Reading to take | Failure meaning | Next action |
|---|---|---|---|
| Physical/network path | Interface state and route from the Gateway host | The request cannot reach the destination network | Repair link, VLAN, gateway, or routing configuration |
| Address resolution | Resolution of the configured hostname | The Gateway cannot convert the profile hostname into a destination address | Correct DNS or the profile hostname |
| TCP endpoint | Connection to the profile's configured port | The service is unreachable, blocked, or listening elsewhere | Check the SMTP service and intervening firewall policy |
| TLS mode | Whether the profile uses an immediate secure connection or STARTTLS | The client and server disagree about how encryption begins | Match the profile mode to the SMTP endpoint |
| Authentication | SMTP authentication result | The endpoint was reached, but the supplied account was rejected | Correct the managed profile credentials |
| Message transaction | SMTP acceptance or rejection | Transport worked; sender, recipient, relay, or message policy rejected the request | Use the server response to correct the transaction |
No universal port or timing value can be inferred from the requested fields. Read the hostname, port, connection mode, and timeout behavior from the configured profile and the SMTP service documentation. A port number and a TLS checkbox are not independent guesses: they describe one endpoint contract.
How Should the Module Send Through the Managed Profile?
Keep the module boundary narrow: accept a profile name plus message data, resolve the managed object, and invoke its send operation. Do not accept a password merely to reproduce a Gateway profile internally.
- Declare Ignition
8.1.24as the minimum supported runtime if the module depends unconditionally onEmailProfileManager. - Expose the target profile name as module configuration.
- Obtain
EmailProfileManagerfromGatewayContext. - Resolve the named
EmailProfileand fail locally with a clear profile-name diagnostic when it is absent. - Create the email message using the data required by the profile's
sendEmailoperation. - Call
sendEmailand let the Gateway-managed profile apply its hostname, port, encryption, and authentication configuration. - Record operational success or failure without recording credentials or full sensitive message content.
If the business requirement is configuration inspection rather than message delivery, separate that feature from sending. Apply authorization, redact the password, and expose only fields required by the operator-facing function. Configuration extraction should not become the normal send path.
How Do You Verify the Resolving Branch?
Verification must distinguish profile resolution, endpoint reachability, server acceptance, and final delivery. A successful lookup proves only that the Gateway contains a profile with the requested name. A successful TCP connection proves only network reachability. SMTP acceptance still does not prove that a downstream mailbox retained or displayed the message.
- Run the module on Ignition
8.1.48and confirm that it obtainsEmailProfileManager. - Test an intentionally invalid profile name and confirm that the module stops at lookup with a profile-specific diagnostic.
- Restore the valid name and send a controlled message through
EmailProfile.sendEmail. - Check Gateway diagnostics for name-resolution, connection, TLS, authentication, or SMTP rejection failures.
- Confirm acceptance at the SMTP service, then verify the controlled message at its intended destination.
FAQ
What happens if the module runs on Ignition older than 8.1.24?
EmailProfileManager is not part of that runtime API. Set 8.1.24 as the module's minimum compatible version or build a separately maintained legacy integration.
What happens if the SMTP profile name is wrong?
The request stops inside the Gateway before DNS, TCP, TLS, or SMTP activity. Report the configured name, correct it, and repeat profile resolution.
What happens if the hostname resolves but the port is unreachable?
The profile was selected and DNS worked, but the TCP path failed. Check the Gateway host's route, the configured port, the SMTP listener, and firewall policy before investigating credentials.
What happens if STARTTLS does not match the SMTP endpoint?
The TCP connection may open, but the encryption negotiation or subsequent SMTP exchange fails. Match the managed profile's connection mode and port to the service configuration instead of changing either value independently.
How do I confirm that sendEmail completed the full path?
Confirm that the named EmailProfile resolves, the SMTP service accepts the controlled message, and the intended destination receives it; that destination check is the final verification step.