Set Up Email Delivery.
How to configure email delivery in InvoiceScript using SMTP or Resend API so you can send invoices, reminders, and receipts to your customers.
Set Up Email Delivery
For: business owners setting up InvoiceScript for the first time. What you need: SMTP credentials from your email provider, or a Resend API key from resend.com.
How email delivery is configured
InvoiceScript supports two email delivery methods: SMTP and the Resend API. You choose the method during installation. The installer writes the connection details (SMTP host/port/credentials or Resend API key) to the .env file.
To change the delivery method after installation, edit the .env file directly. The Settings > Email page in the admin UI is for the sender identity (from name and from address) only — it does not change the delivery method or connection details.
Option A: SMTP
During installation, select SMTP and enter your server details:
- Host: your mail server (for example,
smtp.gmail.comormail.yourdomain.com) - Port: 587 for TLS, 465 for SSL, 25 for unencrypted
- Encryption: TLS (recommended) or SSL
- Username: your email address or SMTP username
- Password: your email password or app-specific password
To change SMTP settings after installation, edit these values in your .env file:
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_SCHEME=tls
Common SMTP providers
| Provider | Host | Port | Encryption |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | TLS |
| Outlook / Microsoft 365 | smtp.office365.com | 587 | TLS |
| Amazon SES | email-smtp.{region}.amazonaws.com | 587 | TLS |
| Mailgun | smtp.mailgun.org | 587 | TLS |
For Gmail, you need an app-specific password. Regular passwords do not work with SMTP.
Option B: Resend API
Resend delivers email through its API. No SMTP server details are needed — only an API key.
1. Get a Resend API key
Sign up at resend.com, verify your sending domain, and create an API key.
2. Set the API key
During installation, select Resend as the mail delivery method and enter your API key.
To switch to Resend after installation, update your .env file:
MAIL_MAILER=resend
RESEND_API_KEY=re_your_api_key_here
Sender identity
The sender identity is the name and email address shown on outgoing emails. You can edit it in Settings > Email:
- From name: the name that appears in the "From" field (for example, "Northwind Studio")
- From email: the email address used as the sender
Verify delivery
After configuring email delivery, send a test invoice to yourself to verify that emails arrive correctly.
Local development
For local development with Mailpit, select Mailpit in the installer. This configures SMTP on 127.0.0.1:1025 with no authentication. Mailpit captures all outgoing email at http://localhost:8025.
What can go wrong
- Connection refused. Check that your host and port are correct, and that your firewall allows outbound connections on that port. For Resend, verify that your server can reach the Resend API over HTTPS.
- Authentication failed. Verify your username and password. Some providers require app-specific passwords. For Resend, verify your API key is valid and not revoked.
- Emails go to spam. Set up SPF, DKIM, and DMARC records for your sending domain. Resend provides domain verification and DNS setup guidance, but you still need to add the required DNS records for your domain.
Related pages
Ready to build?
One-time purchase. Self-hosted. Own every file forever.