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 Sep 24, 2026 · 606 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" [email protected]

Using sendmail

sendmail [email protected]         

Was this article helpful?