文章目录
前言
如题:完成了ubuntu定时发送邮件任务。
其中包括:apt install无源报错、apt-get update 无公钥报错、获取邮箱 smtp 授权码、发送邮件、编辑shell、crontab设置
以下是本篇文章正文内容,下面案例可供参考
一、配置邮件工具(heirloom-mailx 或 s-nail 或 mailx 等,选其一即可,)
建议安装s-nail
(1)安装heirloom-mailx
sudo apt install heirloom-mailx
#如果报错package has no installation candidate
#则需要添加源 这里可以选择添加其它源 此处仅为例子
sudo vim /etc/apt/sources.list
deb http://cz.archive.ubuntu.com/ubuntu xenial main universe
sudo apt-get update
#如果报错GPG error:The following signatures couldn‘t be verified because the public
#需要添加公钥