0%

Linux 用sendEmail 发送邮件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
tar -zxvf sendEmail-v1.56.tar.gz
cp -a sendEmail-v1.56/sendEmail /usr/local/bin/
chmod +x /usr/local/bin/sendEmail


wait $!
email_reciver="xxx@qq.com"
#发送者邮箱
email_sender=xxx@163.com
#邮箱用户名
email_username=xxx@163.com
#邮箱密码
#使用qq邮箱进行发送需要注意:首先需要开启:POP3/SMTP服务,其次发送邮件的密码需要使用在开启POP3/SMTP服务时候腾讯提>供的第三方客户端登陆码。
email_password=123qwe
file1_path=${Nginx_logs}${Log_Name}_${before_yesterday}.log.gz
#smtp服务器地址
email_smtphost=smtp.163.com
email_title="日志"-${Log_Name}_${before_yesterday}.log.gz
email_content=${file1_path}

/usr/local/bin/sendEmail -f ${email_sender} -t ${email_reciver} -s ${email_smtphost} -u ${email_title} -xu ${email_username} -xp ${email_password} -m ${email_content} -a ${file1_path} ${file2_path} -o message-charset=utf-8