使用自己的有邮箱发送
首先要开启STMP授权码,以QQ邮箱为例
说明一点不用命令行安装也可以,在命令行中输入会提示你是否安装s-nail
,一直y
即可
mail
下载必须要的安装包
sudo dnf install -y s-nail
进入配置文件中
vim /etc/s-nail.rc
导入配置文件
#邮箱
set from=3324855376@qq.com
#默认smtp发送,stmp发送需要在邮箱内配置,允许stmp发送
set smtp=smtp.qq.com
#邮箱
set smtp-auth-user=3324855376@qq.com
#邮箱授权码
set smtp-auth-password=xkhqkjleqxewchhd
set smtp-auth=login
但是这个旧的版本配置,可以正常发送邮件只是会给出警告
s-nail: Warning: variable superseded or obsoleted: smtp
s-nail: Warning: variable superseded or obsoleted: smtp-auth-user
s-nail: Warning: variable superseded or obsoleted: smtp-auth-password
s-nail: Obsoletion warning: please do not use *smtp*, instead assign a smtp:// URL to *mta*!
s-nail: Obsoletion warning: Use of old-style credentials, which will vanish in v15!
s-nail: Please read the manual section "On URL syntax and credential lookup"
echo "This is a test email" | mail -s "Test Email" 1319900154@qq.com
进入配置文件中
vim /etc/s-nail.rc
导入配置文件
# 必须-固定格式
set v15-compat
# 设置你的邮箱地址
set from=3324855376@qq.com
# 需要将xxx.@qq.com进行URL-encoded编码,密码(授权码)同理
set mta=smtp://3324855376%40qq.com:授权码@smtp.qq.com smtp-use-starttls
# 必须-固定格式
set smtp-auth=login