Docs / Email Servers / How to Send Email from the Command Line

How to Send Email from the Command Line

By Admin · Feb 25, 2026 · Updated Apr 25, 2026 · 504 views · 1 min read

Send test emails or notifications directly from your server.

Using mail Command

apt install mailutils -y\necho "Email body" | mail -s "Subject" recipient@example.com

Using sendmail

sendmail recipient@example.com         

Was this article helpful?