Skip to content

Email and SMTP Configuration

SetGet uses SMTP to send transactional emails — workspace invitations, password resets, magic link codes, and notification digests. A working SMTP configuration is essential for most user-facing flows.

Navigate to Admin Panel > Email / SMTP or go directly to /backoffice/settings/email.

Why SMTP matters

Without a configured SMTP server, the following features will not function:

FeatureImpact
Workspace invitationsUsers cannot be invited by email
Password resetUsers cannot recover forgotten passwords
Magic link authenticationPasswordless login is unavailable
Notification digestsPeriodic email summaries are not sent
Welcome emailsNew users do not receive onboarding messages

WARNING

Configure SMTP before inviting users to your instance. Without it, invitation emails will silently fail and users will have no way to join.

SMTP settings reference

SettingDescriptionRequiredEnvironment Variable
SMTP HostMail server hostname or IP addressYesSETGET_SMTP_HOST
SMTP PortMail server portYesSETGET_SMTP_PORT
UsernameSMTP authentication usernameYesSETGET_SMTP_USERNAME
PasswordSMTP authentication passwordYesSETGET_SMTP_PASSWORD
From EmailSender email addressYesSETGET_SMTP_FROM_EMAIL
From NameSender display nameNoSETGET_SMTP_FROM_NAME
Use TLSEnable TLS/SSL encryptionYes
TLS Modeimplicit (port 465) or starttls (port 587)Yes

Configuring SMTP step by step

  1. Open Admin Panel > Email / SMTP.
  2. Enter your SMTP server hostname in the SMTP Host field.
  3. Enter the port number in the SMTP Port field.
  4. Select the appropriate TLS Mode:
    • Implicit TLS for port 465 — connection is encrypted from the start.
    • STARTTLS for port 587 — connection upgrades to TLS after initial handshake.
  5. Enter your Username and Password.
  6. Set the From Email address (e.g., noreply@example.com).
  7. Optionally set the From Name (e.g., SetGet Notifications).
  8. Click Send Test Email to verify the configuration.
  9. Check your inbox for the test email.
  10. Click Save to persist the settings.

TLS and port selection

Choosing the right port and TLS mode is the most common source of SMTP configuration errors.

PortTLS ModeDescriptionRecommended
25None or STARTTLSLegacy SMTP relay, often blocked by ISPsNo
465Implicit TLSDirect encrypted connectionYes
587STARTTLSStarts unencrypted, upgrades to TLSYes
2525STARTTLSAlternative port used by some providersSometimes

TIP

When in doubt, try port 465 with implicit TLS first. It is the most reliable option and avoids STARTTLS negotiation issues.

Test email

After entering your SMTP configuration, always send a test email before saving:

  1. Click Send Test Email.
  2. The test email is sent to the currently logged-in admin's email address.
  3. If successful, a green confirmation appears: "Test email sent successfully."
  4. If it fails, an error message describes the issue (connection refused, authentication failed, TLS handshake error, etc.).

Common test email failures:

ErrorCauseSolution
connection refusedWrong host or portVerify SMTP host and port
authentication failedWrong username or passwordCheck credentials; some providers require app-specific passwords
TLS handshake failedWrong TLS mode for the portUse implicit TLS for 465, STARTTLS for 587
timeoutFirewall blocking outbound SMTPOpen the SMTP port in your firewall rules
certificate errorSelf-signed or expired certificateUpdate the mail server certificate or configure CA trust

Provider-specific guides

Gmail

Google's SMTP servers work well for small deployments or testing.

SettingValue
SMTP Hostsmtp.gmail.com
SMTP Port465
TLS ModeImplicit TLS
UsernameYour Gmail address
PasswordApp-specific password (not your Gmail password)
From EmailYour Gmail address

WARNING

Gmail requires an App Password when 2-factor authentication is enabled (which it should be). Generate one at myaccount.google.com/apppasswords. Gmail has a sending limit of approximately 500 emails per day for personal accounts.

SendGrid

SendGrid is a dedicated transactional email service suitable for production deployments.

SettingValue
SMTP Hostsmtp.sendgrid.net
SMTP Port465
TLS ModeImplicit TLS
Usernameapikey (literal string)
PasswordYour SendGrid API key
From EmailA verified sender address in SendGrid

TIP

Set up domain authentication (SPF, DKIM) in SendGrid to improve email deliverability and avoid spam filters.

Amazon SES

Amazon Simple Email Service is a cost-effective option for high-volume deployments.

SettingValue
SMTP Hostemail-smtp.{region}.amazonaws.com (e.g., email-smtp.eu-west-1.amazonaws.com)
SMTP Port465
TLS ModeImplicit TLS
UsernameSES SMTP username (not your AWS access key)
PasswordSES SMTP password (not your AWS secret key)
From EmailA verified email or domain in SES

WARNING

SES starts in sandbox mode, where you can only send to verified email addresses. Request production access from the AWS Console before deploying to users.

Custom / self-hosted SMTP

For self-hosted mail servers (Postfix, Haraka, Mail-in-a-Box, etc.):

SettingValue
SMTP HostYour mail server hostname or IP
SMTP Port465 or 587
TLS ModeMatch your server's configuration
UsernameAs configured on your mail server
PasswordAs configured on your mail server
From EmailAny address your server is authorized to send from

Ensure your mail server has valid TLS certificates, proper SPF records, and DKIM signing configured to avoid deliverability issues.

Email deliverability tips

To maximize the chance that emails reach user inboxes:

  1. Set up SPF records — Add a DNS TXT record authorizing your SMTP server to send on behalf of your domain.
  2. Configure DKIM signing — Most email providers and mail servers support DKIM. This cryptographically signs outgoing emails.
  3. Set up DMARC — A DMARC policy tells receiving servers how to handle emails that fail SPF or DKIM checks.
  4. Use a dedicated sending domain — Avoid sending from a personal email address in production.
  5. Monitor bounce rates — High bounce rates can damage your sender reputation.

Environment variable override

SMTP settings can be configured via environment variables instead of (or in addition to) the Admin Panel. Environment variables take precedence over Admin Panel values.

bash
export SETGET_SMTP_HOST="smtp.example.com"
export SETGET_SMTP_PORT="465"
export SETGET_SMTP_USERNAME="noreply@example.com"
export SETGET_SMTP_PASSWORD="your-smtp-password"
export SETGET_SMTP_FROM_EMAIL="noreply@example.com"
export SETGET_SMTP_FROM_NAME="SetGet"

WARNING

Never commit SMTP credentials to source control. Use environment variables, secrets management, or a .env file excluded from version control.

Email queue and retry behavior

SetGet queues outgoing emails in Redis and processes them asynchronously. This provides resilience against temporary SMTP outages.

SettingDescriptionDefault
Queue sizeMaximum number of emails in the queue10,000
Retry attemptsNumber of times to retry a failed send3
Retry delayTime between retry attempts30 seconds (exponential backoff)
Dead letter thresholdAfter this many failures, move to dead letter queue3

When an email fails all retry attempts, it is moved to the dead letter queue. Administrators can view and manually retry dead-letter emails from the SMTP settings page.

Monitoring email delivery

The SMTP settings page includes a delivery summary:

MetricDescription
Sent (24h)Emails successfully sent in the last 24 hours
Failed (24h)Emails that failed to send
QueuedEmails currently waiting to be sent
Dead letterEmails that exhausted all retries
Average send timeMean time from queue to SMTP handshake completion

Email types reference

SetGet sends the following email types through SMTP:

Email TypeTriggerTemplate Customizable
WelcomeUser registrationYes
Workspace InvitationMember invitedYes
Password ResetReset requestYes
Magic LinkMagic link requestYes
Notification DigestScheduled deliveryYes
Account LockedBrute-force lockoutNo
GDPR Export ReadyData export completedNo
Test EmailAdmin sends testNo

Troubleshooting SMTP

ProblemDiagnosisSolution
Emails go to spamMissing SPF/DKIM/DMARCSet up DNS records for your sending domain
Emails delayedQueue backlogCheck Redis connectivity and queue size
"Relay access denied"Mail server rejects senderVerify the From Email is authorized on your SMTP server
Intermittent failuresNetwork instabilityCheck firewall rules and DNS resolution for SMTP host
Rate limit exceededProvider sending limit reachedReduce email volume or upgrade your SMTP plan