標籤:
1.Install
sudo apt-get install mutt msmtp
2.Config
sudo vim /etc/Muttrc
增加如下內容
set sendmail="/usr/bin/msmtp"set use_from=yesset envelope_from=yesset realname="yourname"set [email protected]
然後msmtp的設定檔為~/.msmtprc,有時候不會自動建立,可以找個模板自己改
dpkg -L mstmpmv /usr/share/doc/msmtp/examples/msmtprc-user.example ~/.msmtprc
內容大致如下
# Example for a user configuration file# Set default values for all following accounts.defaultstls ontls_trust_file /etc/ssl/certs/ca-certificates.crtlogfile ~/.msmtp.log# A outlook service# The SMTP server of the outlook.account outlook host smtp-mail.outlook.comport 587from [email protected]auth onuser [email protected]password you_password# Set a default accountaccount default : outlook
記得修改檔案許可權
chmod 600 ~/.msmtprc
3.Usage
mutt
或者
ehco "content" | mutt [email protected] -s "subject" -a file
可直接發送郵件
linux下利用mutt來發mail