How to send an email using sendmail command in linux?


by lia , in category: General Help , 21 days ago

How to send an email using sendmail command in linux?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by georgiana.senger , 20 days ago


To send an email using the sendmail command in Linux, you can follow these steps:

  1. Open a terminal or shell on your Linux system.
  2. Use the following command to compose an email and send it:
echo "Subject: Email Subject" | sendmail -v

Replace "Email Subject" with the desired subject of your email and "" with the recipient's email address. You can also add the email body by typing it after the recipient's email address.

  1. Press Enter to send the email.
  2. You might be prompted to provide the email content after pressing Enter. Type in the email body if prompted.
  3. Once the email is sent, you should see output similar to the following:
2 Transmitted (Message ID: <>)
Closing connection to []

Note: To use the sendmail command, make sure it is installed on your system. If it's not already installed, you can install it using the package manager specific to your Linux distribution.