Skip to main content

Email (SMTP)

The Email (SMTP) category configures outbound email for your Hawkra instance. Email is used for user registration verification codes, password reset links, and system notifications. Without SMTP configured, all email-dependent features are disabled.

SMTP configuration panel

Settings Reference

SMTP Host

Keysmtp_host
TypeString
DefaultEmpty
EncryptedNo

The hostname of your SMTP mail server. This is the server that Hawkra connects to for sending emails.

Examples: smtp.gmail.com, smtp.sendgrid.net, smtp.mailgun.org, mail.yourdomain.com

SMTP Port

Keysmtp_port
TypeInteger
Default587
EncryptedNo

The port number for the SMTP connection. The correct port depends on the encryption method:

PortEncryptionProtocol
587STARTTLSConnects in plaintext, then upgrades to TLS. Most common and recommended.
465SSL/TLSConnects with TLS from the start (implicit TLS).
25NoneUnencrypted SMTP. Not recommended for production use.

SMTP Encryption

Keysmtp_encryption
TypeDropdown (starttls or ssl)
Defaultstarttls
EncryptedNo

The encryption method for the SMTP connection:

  • STARTTLS — The connection starts unencrypted and upgrades to TLS via the STARTTLS command. Use with port 587.
  • SSL — The connection uses TLS from the start (implicit TLS). Use with port 465.

SMTP Username

Keysmtp_username
TypeString
DefaultEmpty
EncryptedYes

The username for SMTP authentication. This is typically your email address or an API username, depending on your email provider.

SMTP Password

Keysmtp_password
TypeString
DefaultEmpty
EncryptedYes

The password or API key for SMTP authentication. This value is stored encrypted in the database. When viewing the settings page, it appears masked as •••••••• — click Change to enter a new value.

SMTP From Address

Keysmtp_from_address
TypeString
DefaultEmpty
EncryptedNo

The sender email address that appears in the "From" field of outbound emails. This should be an address associated with your SMTP account or domain to avoid delivery issues.

Example: noreply@yourdomain.com, hawkra@yourdomain.com

Provider-Specific Setup

Gmail

Gmail requires an App Password for SMTP access when two-factor authentication is enabled on your Google account (which it should be).

  1. Go to your Google Account settings at myaccount.google.com.
  2. Navigate to Security > 2-Step Verification (enable it if not already active).
  3. Scroll to App passwords at the bottom of the 2-Step Verification page.
  4. Select Mail as the app and your device type, then click Generate.
  5. Copy the 16-character app password.
SettingValue
SMTP Hostsmtp.gmail.com
SMTP Port587
SMTP Encryptionstarttls
SMTP UsernameYour full Gmail address (e.g., you@gmail.com)
SMTP PasswordThe 16-character app password from step 5
SMTP From AddressYour Gmail address
caution

Do not use your regular Gmail password. Google blocks standard password authentication for SMTP. You must generate and use an App Password.

SendGrid

SendGrid uses API keys for SMTP authentication.

  1. Log in to your SendGrid account at app.sendgrid.com.
  2. Navigate to Settings > API Keys.
  3. Click Create API Key, give it a name, and select Restricted Access with at least Mail Send permissions.
  4. Copy the generated API key (it is only shown once).
SettingValue
SMTP Hostsmtp.sendgrid.net
SMTP Port587
SMTP Encryptionstarttls
SMTP Usernameapikey (literal string, not your email)
SMTP PasswordYour SendGrid API key
SMTP From AddressA verified sender address in your SendGrid account

Mailgun

  1. Log in to your Mailgun account at app.mailgun.com.
  2. Navigate to Sending > Domains and select your domain.
  3. Click SMTP credentials to view your SMTP username and password.
SettingValue
SMTP Hostsmtp.mailgun.org
SMTP Port587
SMTP Encryptionstarttls
SMTP UsernameYour Mailgun SMTP username (e.g., postmaster@mg.yourdomain.com)
SMTP PasswordYour Mailgun SMTP password
SMTP From AddressAn address at your verified Mailgun domain

Configuration via Environment Variables

SMTP can also be configured entirely through environment variables. When all six SMTP environment variables are set, the backend initializes email support at startup without needing dashboard configuration.

SettingEnvironment Variable
SMTP HostSMTP_HOST
SMTP PortSMTP_PORT
SMTP EncryptionSMTP_ENCRYPTION
SMTP UsernameSMTP_USERNAME
SMTP PasswordSMTP_PASSWORD
SMTP From AddressSMTP_FROM_ADDRESS
Testing Your Configuration

After configuring SMTP, enable Email Verification in the Access Control settings and register a test user account. If the verification email arrives, your SMTP is working correctly. If not, check the Docker logs for error messages:

cd /opt/hawkra && docker compose logs backend | grep -i smtp
note

Environment variables take priority over dashboard values. If you set SMTP_HOST as an environment variable, the dashboard value for SMTP Host is ignored at runtime. This is useful for keeping secrets like the SMTP password in your .env file rather than the database.