shell利用telnet发邮件报警

首先通过php脚本获取base64_encode 加密过的邮箱用户名和密码

#! /usr/bin/php
<?php
        $str = '99click';
         echo base64_encode($str);
?>
函数

 function maild {

(for a in "helo localhost" "AUTH LOGIN" "cmVudsclcjdSDeWF4dWYemh1LmNvbQ==" "OTlJdsljaw==" "mail FROM:<[email protected]>" "rcpt TO:<[email protected]>" "rcpt TO:<[email protected]>" "data"; do
         sleep 1
         echo ${a}
         sleep 1
     done
     echo "from:<[email protected]>"
     echo "subject:$ip $m disk full!"
     echo ""
     echo "message"
     echo "."
     sleep 1
     echo "QUIT")|telnet smtp.name.com 25
}
需要使用时直接使用

你可能感兴趣的:(PHP,telnet,用户名,休闲,报警)