安装好了这两个包之后,就是进行相关配置文件的配置了:
首先配置 mutt,系统全局设置配置文件在 /etc/Muttrc,如果使用某个系统用户,可以在~/.muttc中设置,没有该文件,就自己创建。
vi .muttrc
2 setuse_from = yes
3 setrealname = zhxia 4 setfrom = zhenghongxia @ anjuke.com
5 setenvelope_from = yes
安装好了这两个包之后,就是进行相关配置文件的配置了:
首先配置 mutt,系统全局设置配置文件在 /etc/Muttrc,如果使用某个系统用户,可以在~/.muttc中设置,没有该文件,就自己创建。
vi .muttrc
接着,配置msmtp
创建 ~/.msmtprc 和 ~/.msmtp.log,分别为配置文件和日志文件
vi .msmtprc
chmod 600 .msmtprc
同时创建 日志文件 touch ~/.msmtp.log
做完了以上的配置之后,可以进行邮件的发送测试了:
查看SMTP服务器是否支持认证的TLS加密:
发送邮件测试:
一般情况下,均可已正常接收邮件。
hello " 252578390 @ qq.com,zhenghong - xia @ 163 .com - c 402714871 @ qq.com - a / tmp / ip.tmp
发送给多人,抄送,添加附件
address
=
zhenghongxia@anjuke.com
"
echo
$content
|
mutt
-
s
${subject}
"
-
e'setcontent_type
=
text/html
"
'
-
e'send
-
hook.
my_hdrX-Priority:1
"
'
$address
发送邮件时设置邮件的文本类型为:html格式,邮件的等级为:重要
参考文章:
http://hi.baidu.com/realasking/blog/item/10c1c3d346be6cd2a9ec9adc.html
原文地址:https://www.jb51.cc/ubuntu/353668.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。