CloudLinux.ro
Email

How to send email from your app over SMTP

Updated 7/20/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 pricing

Related tutorials