这里写出两种常用的邮件发送方式:

mail:

需要安装sendmail和postfix两个服务

编辑/etc/mail.rc,在最后添加

 

set from=scottcho@126.com smtp=smtp.126.com
set smtp-auth-user=scottcho  smtp-auth-password=xxxx
set smtp-auth=login

 

  

 

 

  没有附件的邮件:

    echo "hello"|mail -s "test mail" scottcho@qq.com

        或者

    mail -s "测试" scottcho.qq.com <new.txt

  发送带有附件的邮件:

    mail -s '测试' -a applicationContext-mail.xml scottcho.qq.com < new.txt

需要注意的是服务器的hostname应该为xxx.xxx的形式,不然会QQ和163等一些邮箱拦截

 

Mutt:

  mutt -s "test mail" scottcho@qq.com -a /etc/hosts <new.txt

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2022-01-15
  • 2021-12-24
  • 2021-12-10
猜你喜欢
  • 2021-05-31
  • 2022-01-17
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
相关资源
相似解决方案