邮箱
第一步:下载解压包
wget http://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz
第二步:解压缩
tar zxvf heirloom-mailx_12.5.orig.tar.gz
第三步:跳转到解压缩目录下
第四步:编译安装make && make install UCBINSTALL=/usr/bin/install
第五步:编辑配置文件vi /etc/mail.rc
# This is the configuration file for Heirloom maklx (formerly
#known under the name "nail".
#See mailx(1) for further options.
#This file is not overwritten when 'make install' is run in
#the mailx build process again.
#sccsid @(#)nail.rc 2.11(gritter) 8/2/08
#Do not forward to mboox by default since this islikely to be
# irritating for most users today.
set hold
# Ask for a message subject.
set ask
#Assume a CRT-like terminal and invoke a pager.
set crt
第六步:配置发送邮件信息vi /etc/mail.rc
在配置文件的最后添加如下代码:
# 配置发送邮件的信息
set from=123456@qq.com #(需修改)和第三行邮箱地址保持一致
set smtp="smtp.qq.com" #(需修改)所使用的外部邮箱的smtp服务器地址
set smtp-auth-user="123456@qq.com" #(需修改)所使用的外部邮箱的用户名
set smtp-auth-password="admin" #(需修改)授权码
set smtp-auth="login"
遇到问题:发送邮件遇到问题
send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
解决:
vi /etc/postfix/main.cf
如果是要在阿里云的远程服务器上发送邮件,上面的配置就不能成功,因为25端口不能使用。所以需要借助其他手段:https://blog.csdn.net/qq_42859864/article/details/84862977
可以输入命令进行测试:
echo "test" | mail -s "test" 456789@qq.com #这里填写收件人的邮箱
版权声明:本文为CSDN博主「二木成林」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/cnds123321/article/details/106483355