Ubuntu通过mail发送邮件

先修改/etc/s-nail.rc中来添加外部SMTP服务器如下:

set from=zpmail@wp.cpxiang.tech
set smtp="smtps://smtp.qq.com:465"
set smtp-auth=login
set smtp-auth-user=1324928751
set smtp-auth-password=<授权码>

尝试发送

echo "nihao" | mail -s "test" 1324928751@qq.com

发表评论?

4 条评论。

  1. ubuntu18.04+上无法直接安装heirloom-mailx,需要添加软件源:
    sudo vi /etc/apt/sources.list
    写入:
    deb http://cz.archive.ubuntu.com/ubuntu xenial main universe
    安装heirloom-mailx:
    sudo apt-get update
    sudo apt install heirloom-mailx

  2. test:
    echo “邮件内容” | s-nail -s “邮件主题” 1324928751@qq.com

  3. cat access.log | awk ‘$1~/188.131.146.160/{print $1,$4,$5,$6,$9,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23}’

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.