How to send email from your app over SMTP
Updated 10/16/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
How to filter spam with Rspamd
Rspamd is a modern, fast spam filter. Here is how to use it to keep your inbox clean.
Updated 10/16/2026EmailHow to secure a mail server
A misconfigured mail server becomes a spam source. Here are the essential security rules.
Updated 10/16/2026EmailHow to check if your IP is on an email blacklist
If your emails are rejected, your IP might be on a blocklist. Here is how to check and what to do.
Updated 10/16/2026