Sendmail command

The sendmail command!

sendmail is a command-line utility that allows you to send email messages from the command line. It's a part of the Sendmail mail transfer agent (MTA) package, which is a popular open-source MTA used on many Unix-like systems.

Here's a basic syntax for the sendmail command:

sendmail [options] [email protected]

Where:

Here are some examples of using the sendmail command:

Sending a simple email

sendmail [email protected]

This will prompt you to enter the email message, subject, and sender's email address.

Sending an email with a specific subject

sendmail -s "Hello, World!" [email protected]

This will send an email with the subject "Hello, World!" to the recipient.

Sending an email with a specific body

sendmail -b "This is the email body." [email protected]

This will send an email with the body "This is the email body." to the recipient.

Sending an email with a specific sender

sendmail -f [email protected] [email protected]

This will send an email from the sender [email protected] to the recipient.

Sending an email from a file

sendmail -t < email.txt [email protected]

This will send an email from the file email.txt to the recipient.

Note that the sendmail command is usually used in conjunction with other tools, such as mail or mutt, to compose and send email messages. Additionally, the sendmail command may not work on all systems, as it's specific to Unix-like systems.