ubuntu中怎么配置外部smpt发送邮箱
ubuntu中怎么配置外部smpt发送邮箱?相信大部分人都还没学会这个技能,为了让大家学会,给大家总结了以下内容,话不多说,一起往下看吧。添加heirloom-mailx apt源cat /etc/apt/sources.list.d/mailx.list
deb ?xenial main universe
更新apt
apt update
安装heirloom-mailx
apt install heirloom-mailx -y
配置外部发件邮箱
编辑 /etc/s-nail.rc在最后加上:
for 163邮箱set from="[email protected]" ??#发件地址
set smtp="smtps://smtp.163.com:465" ??#smtp服务器
set smtp-auth-user="[email protected]" ?#登录发件地址
set smtp-auth-password="xxxx" ??#明文密码
set smtp-auth=login ??#登录方式,默认是login,也可以改成CRAM-MD5或PLAIN方式
for outlookset from="[email protected]"
set smtp="outlook.office365.com:587"
set smtp-auth-user="[email protected]"
set smtp-auth-password="xxxx" ???#明文密码
set smtp-use-starttls ?#加密方式
set ssl-verify=ignore ?# 忽略ssl认证
set smtp-auth=login
for QQ mailset from="[email protected]"
set smtp="smtps://smtp.qq.com:465"
set smtp-auth-user="[email protected]"
set smtp-auth-password="ahkphxxabcbshabbga" #QQ邮箱授权码
set smtp-auth=login
常用命令
常用命令:
n:不读入设置文件(本系统中是/etc/s-nail.rc)(这个文件允许用户使用外部邮件传输代理而不是使用系统自带的sendmail发送邮件)。
s:设置邮件的主题信息。
c:使用一个抄送列表。
b:使用一个密送列表。发送测试邮件
echo "内容"|s-nail -s "主题" [email protected],[email protected] #多个邮箱用逗号隔开
或者:
s-nail -s "邮件主题" [email protected] ?< result.txt
加参数v可以看到mail输出的详细信息
s-nail -vs "邮件主题" [email protected] < result.txt发送带附件
s-nail -a 附件 -s "主题" 收件地址 < 文件(邮件正文.txt)
s-nail -a /xxx.tar.gz -s "主题" [email protected] < ./xxx.txtshell 当编辑器,编辑完内容后按Ctrl-D结束
s-nail -s '主题‘ [email protected]看完这篇文章,你们学会在ubuntu中配置外部smpt发送邮箱的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注Vecloud行业资讯频道,感谢各位的阅读。
页:
[1]