How to configure sendmail/postfix to relay or forward emails via an SMTP server
- Uninstall sendmail
- Install postfix
yum install postfix
# or
apt-get install postfix
- Configure postfix
sudo vim /etc/postfix/main.cf
Add:
relayhost = smtp.devil.com
yum install postfix
# or
apt-get install postfix
sudo vim /etc/postfix/main.cf
Add:
relayhost = smtp.devil.com
Sending emails with sendmail can be easy as long as you remember the syntax:
$ sendmail [email protected]
Subject: testing
Hello
Press CTRL-D to send the message.