首页 > 系统服务 > 详细

ubuntu是哟mailx发送邮件

时间:2019-04-16 12:31:16      阅读:178      评论:0      收藏:0      [点我收藏+]

搭建邮件发送这么简单的一个功能,我在阿里云ECS上来回倒腾了几天,并且先后使用sendmail、postfix、heirloom-mailx等多种发送邮件的软件。但总是出现各种各样的错误。查找了百度和谷歌以及阿里云开放论坛,终于搞定了,网上的资料好分散,查来查去都是相同内容,索引我把我搭建的经过写出来,希望以后别有人掉坑里了

下面我直接描述邮件发送成功的经过:

1、安装heirloom-mailx

apt install heirloom-mailx

 

2、配置外部SMTP

我的ECS是Ubuntu16.04 ,配置文件为/etc/s-nail.rc,把下面几行放置在最后

如果不配置端口发送可以使用

set from=xxx@163.com
set smtp=smtp.163.com
set smtp-auth-user=xxx@163.com
set smtp-auth-password=123456
set smtp-auth=login

如果配置端口则
set from="xxx@163.com"
set smtp="smtps://smtp.163.com:465"
set smtp-auth-user="xxxm@163.com"
set smtp-auth-password="123456"
set smtp-auth=login

或者
set from="xxx@163.com"
set smtp="smtps://smtp.163.com:465"
set smtp-auth-user="xxxm@163.com"
set smtp-auth-password="123456"
set smtp-auth=login

 

注:以上三种配置都可以尝试


3、发送

echo ‘this is test‘ | mail -s "test email." 123@qq.com

原文:https://blog.csdn.net/just_shunjian/article/details/78677054

ubuntu是哟mailx发送邮件

原文:https://www.cnblogs.com/paad/p/10716060.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!