zoukankan      html  css  js  c++  java
  • 3,设置mail自动发送

    https://www.cnblogs.com/xy51/p/10905652.html

    一、使用yum命令安装
      

    yum -y install sendmail
    yum install -y mail
    yum install -y mutt


    二、启动email命令
        

    查看email运行状态:/etc/init.d/sendmail status
    启动email:/etc/init.d/sendmail start

    三、测试
        

    echo 'test' | mail -s 'test' xxx@qq.com
    mail -a /root/python/1.txt  -s check_test 44@qq.com < /root/python/mail.text 

    mail -a /root/2020-02-15-XXX.xls  -s XXX自动巡检 sun@org.cn < /root/mail.text 


    语法:

    -s 指定邮件主题
    -c 指定抄送的人
    -a 指定发送的附件
    -f 指定从哪个收件箱中读取内容,eg, -f /home/wahaha/mb

    echo "hello,this is the content of mail.welcome to www.mzone.cc" | mail -s "Hello from mzone.cc by pipe"  -c 919571386@qq.com 383264679@qq.com

    四、设置收件人(编辑/etc/mail.rc):
     

    # sendmail config
    set from=fengchao192@126.com
    set smtp=smtp.126.com
    set smtp-auth-user=fengchao192@126.com
    set smtp-auth-password=xxxx
    set smtp-auth=login


    注意:
        email如果查看状态,出现如下情况:
        sendmail 已死,但是 subsys 被锁
        sm-client (pid  10853) 正在运行...

    解决办法:
        查看postfix服务状态:service postfix status
        停止postfix(若启动):service postfix stop
        重新再启动email服务:/etc/init.d/sendmail restart

  • 相关阅读:
    NSClassFromString,NSSelectorFromString,isKingOfClass
    [ios2]10大iOS开发者最喜爱的类库
    [ios2]iphone编程中使用封装的NSLog来打印调试信息 【转】
    [ios2]蓝牙通信【转】
    [ios] Xcode使用设置相关-快捷键【转】
    iOS图片设置圆角
    iOS 时间戳转时间
    iOS 时间转时间戳
    iOS loading等待图
    iOS简便写法
  • 原文地址:https://www.cnblogs.com/xiaomai-rhce/p/11598228.html
Copyright © 2011-2022 走看看