Email - Sendmail (Linux)

1 - About

Sendmail is a mail transfer agent (MTA) for linux. It transfers electronic mail messages from one computer to another using SMTP

Almost all MTAs provide a sendmail interface.

3 - Management

3.1 - Restart

/sbin/service sendmail restart

3.2 - Installation


sudo apt-get install sendmail

3.3 - Submitting mail

This documentation was tested with the sendmail of the postfix MTA.

You can set options at the command line, for instance -F (Set the sender full name) - They correspond to the smtp command.

Type a mail file for the smtp data (headers are separated from the body by a blank line)

Subject: Hello World !
From: nico
To: [email protected]

This is my first mail 

Excited I am

  • You can pipe it in to sendmail

sendmail [email protected] < mail.eml
cat mail.eml | sendmail [email protected]

  • or with a echo

echo -e "Subject:Hello World \n\n This is my first mail \n" | sendmail [email protected]

  • or enter the below command, type in your message, then press Enter and type in a dot and press Enter again.

sendmail [email protected]

3.4 - Sending file attachments

Sendmail does not send mail attachments. You should encode your file using a MIME encoding utility before piping it to sendmail.

4 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap