The article is mainly reference http://www.cnblogs.com/276815076/archive/2011/10/11/2207214.html
Verify that the message has been sent successfully. Please try it out, but you will be at your own risk.
Needless to say, install the software first. We all know about ubuntu. You can use sudo apt-Get install mutt msmtp as a silly sudo. You just need to set everything by default.
Next, start various configurations, which are very simple and don't bother. You can copy them. Of course, I also use Ctrl + C.
Mutt
System global settings/etc/muttrc. If you use a system user, you can ~ /. Muttrc.
Vi. muttrc
Set Sendmail = "/usr/bin/msmtp"
Set use_from = Yes
Set realname = "fengyubin"
Set From = fyb@163.com
Set envelope_from = Yes
Msmtp
Create ~ /. Msmtprc and ~ /. Msmtp. log, which is the configuration file and Log File respectively.
Vi. msmtprc
Account default
Host smtp.163.com
From fyb@163.com
Auth plainuser fybpassword 123456 logfile ~ /. Msmtp. Log because the password is a clear code, we need to modify the permissions of this file.
Chmod 600. msmtprctouch ~ /. Msmtp. Log
Check whether the SMTP server supports authenticated TLS encryption:
Run the following command: msmtp -- Host = smtp.163.com -- serverinfo and press Enter.
SMTP server at smtp.163.com (m5-86.163.com [202.108.5.86]), port 25:
163. com anti-spam GT for coremail System (163com [20050206])
Capabilities:
Pipelining:
Support for command grouping for faster transmission
Auth:
Supported authentication methods:
Plain Login
Here, you can use mutt to send an email. Let's test it.
Echo "test" | mutt-s "my_first_test"
* ** @ Gmail.com
Go to the mailbox and check whether the email is successful!