1, download, decompression msmtp
#wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.30.tar.bz2?big_mirror=0
#tar JXVF msmtp-1.4.30.tar.bz2
2. Installation
#./msmtp-1.4.30/configure–prefix=/usr/local/msmtp
#make
#make Install
3. Configure MSMTP Account
Switch to, CD/USR/LOCAL/MSMTP
New Folder Etc,mkdir etc. Use VI to create a new file, enter Vi/usr/local/msmtp/etc/msmptrc, and edit the following:
Account Default
Host Smtp.163.com
From [email protected]
Auth Login
TLS off
User 18292079713
Password Xiaozhao1
Logfile/var/log/msmtp.log
ESC, save exit. Since password is plaintext, we need to modify this file's permissions chmod ETC/MSMTPRC
4. Installation Configuration Mutt
You can use the which mutt to view mutt installed paths If you do not have the #yum install Mutt
5. Edit the Mutt configuration file
Vi/etc/mutt, edit the total settings of the Mutt, and add a few lines at the end
Set sendmail= "/usr/local/msmtp/bin/msmtp"
Set Use_from=yes
Set Realname= "[Email protected]"
Set [email protected]
Set Envelope_from=yes
Set Rfc2047_parameters=yes
Set editor= "Vim"
Set charset= "Utf-8"
5. Testing
#/usr/local/msmtp/bin/msmtp-s
#/usr/local/msmtp/bin/msmtp-p
#echo "Test" |mutt-s "my_first_test" [email protected]
Combined with cron, you can achieve quite a few functions
Use Mutt to send mail under Linux