- 首先安装mutt+msmtp+openssl
sudo apt-get install openssl ca-certificates mutt msmtp
- 配置msmtp
sudo vim /etc/msmtprc
defaults tls on tls_starttls on tls_trust_file /etc/ssl/certs/ca-certificates.crt account default host smtp.gmail.com port 587 auth on user [email protected] password your_password_yourgmail from [email protected] logfile /var/log/msmtp.log
- 配置mutt
vim ~/.muttrc
set pop_last=yes set pop_pass=yourpassword [email protected] set pop_host=pops://pop.gmail.com set sendmail="/usr/bin/msmtp"
msmtp的路径可以通过
which msmtp
获得. - 发送附件
echo 'content of your email' | mutt -s 'subject of your email' [email protected] -a filename
这就将filename发送到邮箱[email protected].
本作品采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循署名-非商业用途-保持一致的创作共用协议.
“最简单的传送文件的方式:使用mutt+msmtp发送邮件”上的一条回复
[…] 最简单的传送文件的方式:使用mutt+msmtp发送邮件 ↩ […]