zoukankan      html  css  js  c++  java
  • 如何在linux中发送邮件,使用163邮箱发信。

    linux中,可以使用mail命令往外发送邮件,在使用前,只需要指定如下简单配置即可,这里演示用  163.com    邮箱发送至 qq.com

    编辑 /etc/mail.rc,写入下方的参数

    set from=18211146***@163.com     发送邮件的邮箱
     
    set smtp=smtp.163.com            邮箱域名,使用163邮箱发信,要填写smtp.163.com,而不是mail.163.com。
    
    set smtp-auth-user=18211146***@163.com   #邮箱账号
     
    set smtp-auth-password=twgdhbtzhy***       #邮箱登录密码,或者,授权码,使用163邮箱需要设置授权码,这里定义的是授权码,图1-1
    
    set smtp-auth=login
    [root@Centos7 ~]# tail -10 /etc/mail.rc
    
    set from=18211146***@163.com
    
    set smtp=smtp.163.com
    
    set smtp-auth-user=18211146***@163.com
    
    set smtp-auth-password=twgdhbtzhy***
    
    set smtp-auth=login

    图1-1

     设置完毕后就可以发件测试了。

    邮件标题:Hello World

    邮件内容:你好 小戴

    收件方:1274378***@qq.com

    [root@Centos7 ~]# echo "你好,小戴" |mail -s 'Hello World' 1274378***@qq.com

    结果查看。

  • 相关阅读:
    map
    01背包和完全背包 POJ
    并查集 计算节点数量
    set
    map,vector,queue 图 综合运用
    并查集 hdu-1325 Is It A Tree?
    js中的ajax
    java算法
    MySql在Window上的安装
    微信开发账号要求
  • 原文地址:https://www.cnblogs.com/xiaodai12138/p/10119413.html
Copyright © 2011-2022 走看看