Saturday, January 11, 2025
HomeTechHow to send an email using sendmail command in linux

How to send an email using sendmail command in linux

In Linux, you can send an email using the sendmail command. First, ensure sendmail is installed and properly configured. To send an email, use the following command:

bash
echo -e "Subject: Test Email\n\nThis is a test email." | sendmail [email protected]

This command sends an email with the subject “Test Email” and body “This is a test email.” The echo -e part allows for multi-line input. To send emails with attachments, use a tool like mutt.

Make sure the sendmail service is running and that the email server is configured correctly to avoid issues with delivery.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x