Skip to main content
NightOwl’s Email alert channel is bring-your-own-SMTP: we never send mail from a shared pool, so alerts arrive with your domain and your deliverability. This page walks you through configuring SMTP for the common providers, with Gmail as the reference example.

Where to configure it

In the dashboard, open your app and go to Settings → Alerts. In the Email section, click Configure SMTP (or Add another if the app already has an email channel). The form has these fields: After saving, open the channel again with its pencil and click Send Test to send a test email. A successful test confirms your credentials and From: setup are valid. The test is sent from NightOwl’s servers, though, while new-issue, reopened and health alerts are sent by the agent running on your host. So a passing test does not, by itself, guarantee those alerts will arrive. Run php artisan nightowl:test-alert on the server that runs the agent to test that path (see Testing a channel).
Match the port to the encryption. Port 465 requires ssl; port 587 requires tls. The two are not interchangeable: ssl opens an encrypted connection immediately (implicit TLS), while tls connects in plaintext and upgrades via STARTTLS. A mismatched pair (587 with ssl, or 465 with tls) can still pass Send test (the test path tolerates it) but fails from the agent, which uses a stricter SMTP client. That failure shows only in the agent’s error log and in php artisan nightowl:test-alert. If alerts never arrive, check this pairing first.

Gmail (personal or Google Workspace)

Gmail is the most common request, and also the trickiest because Google disabled basic password auth in 2022. You need an App Password, not your regular Google password.

1. Enable 2-Step Verification

App Passwords require 2-Step Verification on the Google account.
  1. Go to myaccount.google.com/security.
  2. Under How you sign in to Google, enable 2-Step Verification if it’s not already on.

2. Generate an App Password

  1. Visit myaccount.google.com/apppasswords.
  2. Name it something identifiable — e.g. “NightOwl alerts”.
  3. Click Create. Google shows a 16-character password once. Copy it immediately; it won’t be shown again.
If the App Passwords page is missing, your account doesn’t have 2-Step Verification enabled, or your Workspace admin has disabled the feature. Ask your admin to allow App Passwords, or use a relay like SendGrid / SES instead.

3. Fill in the NightOwl form

Gmail also accepts port 465 with ssl — both work. Use whichever your firewall allows.

4. Send a test

Save the channel, open it again with its pencil, and click Send Test. The email should land within a few seconds. If it doesn’t:
  • Check spam. First-time senders to a recipient often land there.
  • Read the error. A failed test shows a red toast with the SMTP server’s reply. 535 Username and Password not accepted means the App Password is wrong or was pasted with spaces.
  • Sending limits. Gmail caps outbound at ~500 recipients/day for personal accounts and ~2,000/day for Workspace. For teams with chatty alerts, switch to SendGrid or SES.
Then run php artisan nightowl:test-alert on the server that runs the agent, since that’s where new-issue alerts are sent from.

Workspace with a custom domain

If your Gmail account is you@yourcompany.com on Google Workspace, the config is identical — still smtp.gmail.com:587 with an App Password. The From: address just becomes you@yourcompany.com. Workspace admins can also set up SMTP relay on smtp-relay.gmail.com for higher volume, which avoids per-user App Passwords.

Other common providers

SendGrid

Create the API key under Settings → API Keys → Create API Key with Mail Send → Full Access. The username is literally the word apikey.

Postmark

Postmark uses the same server token for both username and password. Grab it from Servers → your server → API Tokens.

Amazon SES

SES has its own SMTP credentials that are different from your IAM access key. Generate them under SES Console → SMTP Settings → Create SMTP credentials. Before you can send from an address, the domain (or the individual email) must be verified in SES, and the account must be out of the SES sandbox for arbitrary recipients.

Mailgun

Find the SMTP credentials under Sending → Domain settings → SMTP credentials for the domain you’ve set up.

Relays without authentication

An internal relay that accepts mail without a login needs no username or password. Leave both fields empty: the agent then sends no AUTH command. Two things to know about private relays:
  • Send test can’t reach them. Send test runs on NightOwl’s servers, which only connect to public SMTP hosts. For a private or local host it replies that it can’t reach the host and points you to php artisan nightowl:test-alert, which sends through the agent on your server.
  • Some alerts come from NightOwl’s servers. Alerts for issues someone resolves, ignores or reopens are sent by NightOwl’s API, so they won’t reach a private relay. New-issue, auto-reopened and agent health alerts come from the agent and will.
If a username is set but the server doesn’t advertise AUTH, the agent still tries AUTH LOGIN, since some relays accept it without announcing it. If that fails too, the error says so and tells you to clear the username and password to send without logging in. When the server offers STARTTLS, it also suggests setting encryption to TLS, because some servers only offer AUTH after STARTTLS.

Deliverability checklist

Even with working SMTP credentials, alerts can land in spam without proper DNS setup. For any custom domain on any provider:
  • SPF — a TXT record listing the provider’s sending hosts (e.g. v=spf1 include:_spf.google.com ~all for Workspace).
  • DKIM — signing keys published as TXT records. Every major provider generates these automatically and gives you a CNAME or TXT to add.
  • DMARC — a TXT record at _dmarc.yourdomain.com telling receivers what to do with unaligned mail (start with p=none for monitoring, tighten later).
Without SPF/DKIM, Gmail and Microsoft 365 will quietly mark alerts as spam — your test email will land, your real alerts may not.

Troubleshooting

For Gmail: you used your normal password instead of an App Password, or the App Password was copied with spaces. Regenerate and paste without whitespace.For other providers: the credentials are wrong, the account is suspended, or the API key doesn’t have Mail Send permission.
Your host’s outbound firewall blocks the port. New-issue and health alerts are sent from the machine running the agent, so the relevant firewall is yours, not NightOwl’s. A Send test that succeeds from NightOwl’s servers won’t catch this; php artisan nightowl:test-alert on that machine will. Try the other port (587 ↔ 465), and remember to switch encryption to match (587→tls, 465→ssl). On managed hosts like DigitalOcean droplets and many cloud VMs, port 25 is blocked by default but 587 is usually open; some providers block all outbound SMTP until you open a support request.
Send test and real alerts take different paths: the test is sent from NightOwl’s servers, while new-issue alerts are sent by the agent on your own host with a stricter SMTP client. Run php artisan nightowl:test-alert on that host: it sends through the agent’s own client and prints the error for any channel that fails. A passing dashboard test rules out wrong credentials and a bad From: address, but two things it does not rule out:
  1. Outbound SMTP blocked on your host. Your host’s firewall (or your cloud provider) blocks outbound 587/465. The test still works because it leaves NightOwl’s infrastructure, not yours. Confirm with nc -vz smtp.yourprovider.com 587 from the box running the agent.
  2. Port/encryption mismatch. 587 with ssl, or 465 with tls, may pass the lenient test path but fail from the agent. Set 587→tls and 465→ssl.
If both are ruled out, look in spam/junk, check the recipient list and the Notify on events on the channel, and verify DMARC/SPF alignment for the From address.
Send test runs on NightOwl’s servers, which only connect to public SMTP hosts, so a private, local or unresolvable host is refused there. Alerts the agent sends don’t have this limit. Test that path with php artisan nightowl:test-alert on the server that runs the agent. See Relays without authentication.
The relay accepts mail without a login. Clear the username and password on the channel and save. If the server offers STARTTLS, try encryption TLS first: some servers only offer AUTH after STARTTLS.
Recipients must be members of the app’s team, matched without regard to case. Invite the address to the team first, then add it to the channel.
Missing or misconfigured SPF/DKIM. Run the From domain through mxtoolbox.com/deliverability and fix anything flagged. A warmup period is also normal for a brand-new sending domain.
That setting is gone as of 2024. You must use 2FA + App Passwords, or switch to OAuth (not currently supported by NightOwl’s SMTP channel — use a relay like SES or SendGrid instead).

Security notes

  • SMTP credentials are stored as plain JSON in the nightowl_alert_channels table in your own database, because the agent on your server reads them to send alerts. Anyone who can read that table can read them. The dashboard shows the password masked and never sends it back.
  • When you change the password in NightOwl, a running agent uses the new one within about 30 seconds.
  • If you revoke an App Password or API key, the next alert fails. The agent writes the SMTP error to its error log, and php artisan nightowl:test-alert shows it.