Installing sendmail on CentOS and sending emails from the console

Install sendmail

[[email protected]]# yum install sendmail sendmail-cf -y

Add the service to startup

[[email protected]]# chkconfig --level 345 sendmail on

We start the service

[[email protected]]# service sendmail startStarting sendmail: [  OK  ]Starting sm-client: [  OK  ]

Testing (insert your e-mail instead of [email protected]):

[[email protected]]# echo "Test body" | mail -s "Test subject" [email protected]

The letter will probably end up in the SPAM folder.