Forrest logo
back to the sendmail tool

sendmail:tldr:abe57

sendmail: Send an email from you@yourdomain.com (assuming the mail server is configured for this) to test@gmail.com containing the message in `message.txt`.
$ sendmail -f ${you@yourdomain-com} ${test@gmail-com} < ${message-txt}
try on your machine

This command involves the use of the "sendmail" utility to send an email. Here's what each element of the command means:

  1. "sendmail" - This is the command itself, used to send emails from the command line.

  2. "-f ${you@yourdomain-com}" - This flag specifies the sender's email address. In this case, it is set to ${you@yourdomain-com}, which is a placeholder for your actual email address. You need to replace it with your real email address.

  3. "${test@gmail-com}" - This is the recipient's email address. Similarly, ${test@gmail-com} is a placeholder that should be replaced with the actual email address of the recipient.

  4. "< ${message-txt}" - The "<" symbol is used to redirect the input from a file. In this case, it is redirecting the content of the "message-txt" file as the input to the sendmail command. Again, "${message-txt}" is a placeholder for the file name that contains the content of the email message. You need to replace it with the actual file name.

In summary, the command will send an email using the "sendmail" utility, with a specified sender's email address, recipient's email address, and the content of the email message contained in a file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the sendmail tool