Mail from command line linux

You can send and receive emails from the command line in Linux using various tools. Here are a few options:

1. Mail command

The mail command is a simple email client that allows you to send and receive emails. You can use it to send emails to local users or remote users.

Example:

mail -s "Subject" [email protected]

This will open a text editor where you can compose your email. When you're done, save the file and exit the editor. The email will be sent to the recipient.

2. Mutt

Mutt is a popular text-based email client that provides more features than the mail command. You can use it to send and receive emails, as well as manage your email accounts.

Example:

mutt -s "Subject" [email protected]

This will open Mutt's compose window where you can compose your email. When you're done, save the file and exit Mutt. The email will be sent to the recipient.

3. S-nail

S-nail is another text-based email client that provides similar features to Mutt. You can use it to send and receive emails, as well as manage your email accounts.

Example:

s-nail -s "Subject" [email protected]

This will open S-nail's compose window where you can compose your email. When you're done, save the file and exit S-nail. The email will be sent to the recipient.

4. Sendmail

Sendmail is a popular email server that allows you to send emails from the command line. You can use it to send emails to local users or remote users.

Example:

sendmail -t -i [email protected]

This will open a text editor where you can compose your email. When you're done, save the file and exit the editor. The email will be sent to the recipient.

5. Gmail command-line client

If you have a Gmail account, you can use the gmail command-line client to send and receive emails.

Example:

gmail -s "Subject" [email protected]

This will open a text editor where you can compose your email. When you're done, save the file and exit the editor. The email will be sent to the recipient.

Note: You'll need to install the gmail package and set up your Gmail account credentials to use this client.

These are just a few examples of how you can send and receive emails from the command line in Linux. There are many other email clients and tools available, so feel free to explore and find the one that works best for you!