How to send email from your app over SMTP
Updated 11/29/2026
Apps send email often: account confirmations, password resets, invoices. The safest way is over SMTP, with authentication.
Typical SMTP settings
HOST = mail.example.com
PORT = 587
ENCRYPTION = tls
USER = [email protected]
PASSWORD = password
Example in Laravel (.env)
MAIL_MAILER=smtp
MAIL_HOST=mail.example.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
[email protected]
Test
Send a test email and check it in Gmail with "Show original", so SPF and DKIM show "PASS", see deliverability testing.
Port 25 blocked?
Many networks block outgoing port 25 to limit spam. Use port 587 with authentication for sending. If you need port 25 open for a mail server, contact support.
Large volumes
For newsletters or high volumes, a dedicated SMTP relay protects your main server's reputation.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
Newsletters with Listmonk: lists, campaigns and delivery
Send newsletters from your own server with no per-subscriber fee: SMTP, lists, signup forms, campaigns and domain reputation.
Updated 11/29/2026EmailShould you run your own mail server?
The pros, cons and what you need to know before hosting email on your own server.
Updated 11/29/2026EmailHow to secure a mail server
A misconfigured mail server becomes a spam source. Here are the essential security rules.
Updated 11/29/2026