Send mail linux

Sending mail from Linux can be done using various commands and tools. Here are a few examples:

Using the mail command

The mail command is a simple way to send an email from the command line. Here's an example:

mail -s "Subject" [email protected]

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

Using the sendmail command

The sendmail command is a more powerful way to send email from the command line. Here's an example:

sendmail -t -i -v [email protected]

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

Using the mailx command

The mailx command is similar to the mail command, but it allows you to specify more options and features. Here's an example:

mailx -s "Subject" -c "[email protected]" [email protected]

This will send an email to the specified recipient with a subject and a carbon copy (CC) to the specified CC address.

Using the mutt command

The mutt command is a powerful email client that can be used to send and receive email from the command line. Here's an example:

mutt -s "Subject" [email protected]

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

Using the ssmtp command

The ssmtp command is a simple way to send email from the command line using a SMTP server. Here's an example:

ssmtp -t -i -v [email protected]

This will open a text editor where you can type your email message. When you're done, save the file and exit the editor. The email will be sent to the specified recipient using the specified SMTP server.

Using the msmtp command

The msmtp command is similar to the ssmtp command, but it allows you to specify more options and features. Here's an example:

msmtp -t -i -v -a "[email protected]" [email protected]

This will send an email to the specified recipient using the specified account and SMTP server.

Note: These commands assume that you have a working email setup on your Linux system, including a mail transfer agent (MTA) such as Sendmail or Postfix, and a mail user agent (MUA) such as Mutt or Sylpheed.