Connecting to Custom SMTP

Introduction

This article show you the steps required to integrate Gravity SMTP on your website with your own SMTP server. This offers a flexible email configuration option when needing to connect with a service for which we do not have an official integration.

Integration Steps

To allow Gravity SMTP to send messages from your website via SMTP (Simple Mail Transfer Protocol), you will need to complete the following steps:

  1. Create an account on the mail server.
  2. Obtain host and port details for the SMTP server.
  3. Complete the Gravity SMTP Settings screen.
    Go to Gravity SMTP → Settings → Integrations and click the settings cog on the Custom SMTP card. This will open a pop-up modal with all the fields required for Gravity SMTP to connect with your custom SMTP server. See below for a description of these settings.
  4. Click Save Changes button.
    You should be returned to the Settings card page, and the Configured text should show at the bottom of the settings card for Custom SMTP. If your settings card still shows Not Configured, then there was an issue. Check your settings.
Image showing integration is configured.
  1. Enable the integration using the on-off toggle (if you are ready to use it).
    Click the toggle on the settings card to turn on Custom SMTP integration. This will show Custom SMTP as Connected. You can then test using the Gravity SMTP Tools, or using your website. Note that only one integration can be active at a time, so toggling one integration on will toggle any other active integration to off.
Image showing integration is connected.

Custom SMTP Settings

Configuration

Image showing Custom SMTP Configuration Settings
TagDescription
SMTP HostThe address of your mail server
SMTP PortThe port of your SMTP connection. Port 465 is commonly associated with SSL, while ports 25 and 587 are often used with TLS.

General Settings

Image showing Custom SMTP General Settings
TagDescription
Return PathAdds the return path to the email header which indicates where non-deliverable notifications should be sent. Bounce messages may be lost if not enabled.
AuthenticationWhether or not your SMTP server requires a username and password to confirm the identity of the user sending messages. This option should be enabled in most cases. (Default: Enabled)
Auto TLSUsually, SMTP servers use TLS encryption if available. However, on some servers, you may need to disable it due to potential issues. (Default: Enabled)
EncryptionEncryption method used to secure your connection. In most cases, TLS is the preferred choice for SMTP servers. If your SMTP provider provides both SSL and TLS options, we suggest opting for TLS. (Default: TLS)
Authentication UsernameThe username for logging into your mail server.
Authentication PasswordThe password for accessing your mail server.
Default From EmailThe from: address associated with outgoing messages.
Only applied when from: property is not explicitly set in the message being processed.
Force From EmailIf enabled, the From Email will override any plugin settings for all outgoing email messages.
Default From NameThe from: name associated with outgoing messages.
Only applied when from: property is not explicitly set in the message being processed.
Force From NameIf enabled, the From Name will override any plugin settings for all outgoing email messages.

Note: Using an invalid port may cause PHPMailer to time out. Depending on the server configuration, the default timeout setting can be 300 seconds (5 minutes) or more. Please use the correct port for your selected encryption type and server settings.