zoukankan      html  css  js  c++  java
  • 安装Mailx到CentOS(YUM)

    运行环境

    系统版本:CentOS Linux release 7.3.1611 (Core)
    软件版本:无
    硬件版本:无

    安装过程

    1、配置网络

    [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
    TYPE=Ethernet
    BOOTPROTO=static
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    IPV4_FAILURE_FATAL=no
    NAME=ens33
    DEVICE=ens33
    ONBOOT=yes
    IPADDR=192.168.1.22
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.1
    DNS1=114.114.114.114
    [root@localhost ~]# systemctl stop firewalld
    [root@localhost ~]# systemctl disable firewalld
    [root@localhost ~]# vi /etc/sysconfig/selinux
    SELINUX=disabled
    SELINUXTYPE=targeted
    [root@localhost ~]# setenforce 0
    [root@localhost ~]# getenforce
    Permissive
    

    2、配置YUM

    [root@localhost ~]# rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    [root@localhost ~]# yum clean all
    [root@localhost ~]# yum makecache
    

    3、安装Mailx

    [root@localhost ~]# yum -y install mailx
    

    4、配置个人邮箱

    [root@localhost ~]# vi /etc/mail.rc
    将下面配置添加到文件尾部
    set smtp=smtp.163.com          # 邮箱服务器地址
    set smtp-auth=login            # 认证方式:采用用户名和密码登录方式
    set smtp-auth-user=xxx@163.com # 用户名
    set smtp-auth-password=xxx     # 密码(邮箱授权码)
    set from=xxx@163.com           # 绑定发件人
    

    5、发送邮件

    命令格式:echo '邮件内容' | mail -s '主题' <收件人>

    [root@localhost ~]# echo 'hello world!' | mail -s '你好' xxx@qq.com 
    

    我的QQ邮箱已经收到邮件啦!

    乐在分享!~~
  • 相关阅读:
    UVa
    UVa 1630
    P3891 [GDOI2014]采集资源
    一个非常naive的小学数学魔术证明题
    P2831 [NOIP2016 提高组] 愤怒的小鸟
    P4211 [LNOI2014]LCA
    P4137 Rmq Problem / mex 强制在线做法
    P2272 [ZJOI2007]最大半连通子图
    P5664 [CSP-S2019] Emiya 家今天的饭
    盘点linux操作系统中的10条性能调优命令,一文搞懂Linux系统调优
  • 原文地址:https://www.cnblogs.com/network-ren/p/12377573.html
Copyright © 2011-2022 走看看