# PocketBase Email Setup: Complete SMTP & REST API Integration with SadaSend

_By Tayyab Mughal, Founder & AI Chief · 20 September 2026 · 3 min read_

> How to configure transactional email in PocketBase using SadaSend. Fix sendmail deliverability issues, configure Admin UI mail settings, and send emails via Go/JS hooks.

PocketBase's default sendmail is unreliable in production. Learn how to configure SadaSend in the PocketBase Admin UI and dispatch transactional emails with Go and JavaScript hooks.

## Why PocketBase's default sendmail fails in production

PocketBase is beloved by developers for its single-binary architecture: real-time subscriptions, embedded SQLite, and an elegant Admin UI in one Go executable. However, out of the box, PocketBase relies on the local Unix sendmail command to dispatch verification and password reset emails.

In production (whether deployed on Fly.io, Hetzner, Railway, or a VPS), sendmail almost always fails: cloud hosting provider IP ranges are blocked by default spam blacklists, servers lack Forward-Confirmed Reverse DNS (FCrDNS), and SPF/DKIM signatures cannot be generated.

The result: your PocketBase verification emails are rejected by Gmail with SMTP 550 errors or silently dumped into the junk folder.

## Configuring SadaSend in the PocketBase Admin UI

PocketBase includes built-in SMTP client support that can be configured in 60 seconds without writing any code:

1. Log in to your PocketBase Admin UI (e.g. https://pb.yourdomain.com/_/).

2. Navigate to Settings > Mail settings in the left sidebar.

3. Configure the following values:

• Sender name: Your App

• Sender address: noreply@yourdomain.com (Verified in SadaSend)

• SMTP server host: smtp.sadasend.com

• Port: 587

• Username: sadasend

• Password: Your SadaSend API Key (sk_live_...)

• TLS: Check Use STARTTLS

4. Click Send test email to verify the connection. You should receive a verified test email within seconds.

## Sending custom emails using PocketBase hooks (Go and JS)

PocketBase allows you to write custom server-side hooks to trigger emails when database records are created or updated. Here is how to dispatch emails programmatically using PocketBase's $app.newMailClient():

```javascript
// pb_hooks/notifications.pb.js
onModelAfterCreate((e) => {
  const user = e.model;

  const message = new MailerMessage({
    from: {
      address: $app.settings().meta.senderAddress,
      name: $app.settings().meta.senderName,
    },
    to: [{ address: user.get('email') }],
    subject: 'Welcome to our platform!',
    html: `<p>Hello <strong>${user.get('name')}</strong>, your account is active.</p>`,
  });

  $app.newMailClient().send(message);
}, 'users');
```

## Automated suppression protection for PocketBase

One of the biggest risks with self-hosted BaaS platforms is dirty user input. If a bot or user signs up with an invalid email address, repeated sends damage your domain reputation.

When connected to SadaSend, every hard bounce and complaint is automatically added to your account-wide suppression list. Subsequent send attempts to invalid addresses are intercepted before reaching the network, keeping your bounce rate under 0.1% and protecting your domain.

> Pairing PocketBase with SadaSend gives you the speed of a single-binary backend with the enterprise deliverability of a dedicated transactional email provider.

---

_Tags: PocketBase, Go, SQLite, BaaS, SadaSend_
